Skip to content

fix: check data batch nullability match with schema in write process#122

Merged
zjw1111 merged 5 commits into
alibaba:mainfrom
lszskye:fix_schema_not_nullable_data_null
Feb 6, 2026
Merged

fix: check data batch nullability match with schema in write process#122
zjw1111 merged 5 commits into
alibaba:mainfrom
lszskye:fix_schema_not_nullable_data_null

Conversation

@lszskye

@lszskye lszskye commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Linked issue: close #121

Verify whether the nullability of the data is consistent with that defined in the table schema during data writing.

Tests

WriteInteTest

Comment thread src/paimon/common/utils/arrow/arrow_utils.h
@lucasfang
lucasfang requested a review from Copilot February 6, 2026 09:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds nullability validation to ensure data written to tables conforms to the schema's nullability constraints. The validation checks that fields marked as non-nullable in the schema do not contain null values in the data.

Changes:

  • Implemented CheckNullabilityMatch utility function with support for nested types (struct, list, map)
  • Added validation in the write process to verify data nullability matches schema constraints
  • Enhanced API documentation to clarify nullability requirements

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/paimon/common/utils/arrow/arrow_utils.h Added CheckNullabilityMatch method and supporting logic for validating nullability across nested data types
src/paimon/common/utils/arrow/arrow_utils_test.cpp Added comprehensive test coverage for nullability validation across simple and complex nested types
src/paimon/core/operation/abstract_file_store_write.cpp Integrated nullability check into the write process
test/inte/write_inte_test.cpp Added integration test verifying nullability validation during write operations
test/inte/blob_table_inte_test.cpp Removed obsolete blob-specific null value test
src/paimon/core/table/sink/commit_message_test.cpp Simplified test schema and data generation to align with actual field types
include/paimon/record_batch.h Enhanced documentation to clarify nullability requirements for RecordBatchBuilder
include/paimon/file_store_write.h Enhanced documentation to clarify nullability requirements for Write method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/paimon/record_batch.h Outdated
Comment thread src/paimon/common/utils/arrow/arrow_utils.h Outdated
Comment thread src/paimon/common/utils/arrow/arrow_utils.h Outdated
Comment thread test/inte/blob_table_inte_test.cpp
Comment thread src/paimon/core/operation/abstract_file_store_write.cpp

@zjw1111 zjw1111 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@zjw1111
zjw1111 merged commit e8af7ef into alibaba:main Feb 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] read parquet file error or read parquet file coredump while write data batch is inconsistent with table schema

5 participants