[arrow] Use the nested field's own nullability for sub writers#8758
Merged
JingsongLi merged 2 commits intoJul 23, 2026
Merged
Conversation
Generated-by: Claude Code
Contributor
|
ArrowUtils.toArrowField always declares the Arrow map key field as NOT NULL (per the Arrow spec, MapVector keys cannot be null). The previous change made the key writer use the declared key type's own nullability, so a nullable key type (the default INT key is nullable) would silently write a null key into a vector whose schema forbids it, instead of failing loud. Keep the key writer non-nullable regardless of the key type. The value, array/vector element, and row-field branches still mirror each nested type's own nullability, which is what the schema declares for them. Add testWriteNullKeyInMapColumnFailsLoud covering the null-key case. Generated-by: claude-code
Contributor
Author
|
Thanks, good catch. You're right — |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
fix #8757
ArrowFieldWriterFactoryVisitorpassed the parent field'sisNullableto ARRAY/VECTOR/MAP/ROW sub writers, andArrowFieldWriter.writerejects null withIllegalArgumentExceptionwhen that flag is false. AnARRAY<INT> NOT NULLcolumn therefore rejected valid null elements, while a NOT NULL child under a nullable parent silently accepted nulls.isNullable(), matching the child nullabilityArrowUtils.toArrowField()declares.ArrowUtils.createArrowFieldWriters()(test-only caller).toArrowField()declares the Arrow key field not-null, left as a follow-up.ArrowFormatWriter.Tests
ArrowFormatWriterTestcases covering null children under NOT NULL ARRAY/MAP columns and NOT NULL ARRAY elements / nested ROW fields. All four fail before the change.mvn -pl paimon-arrow -am clean install— 52 tests passed.mvn -pl paimon-core -Dtest=ArrowBatchConverterTest test— 21 tests passed.