Skip to content

[GLUTEN-13715][FLINK] Keep ROW fields aligned when a null ROW is written inside an ARRAY or MAP - #13716

Open
LuciferYang wants to merge 2 commits into
apache:mainfrom
LuciferYang:vl18-c8-flink-struct-null
Open

LuciferYang wants to merge 2 commits into
apache:mainfrom
LuciferYang:vl18-c8-flink-struct-null

Conversation

@LuciferYang

@LuciferYang LuciferYang commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

ArrowVectorWriter handled a null value by clearing the validity bit only. A ROW's field writers are advanced only for non-null rows, so after a null ROW inside an ARRAY or MAP, the fields of every later element were read from the wrong index.

BaseVectorWriter now writes nulls through an overridable setNull, and StructVectorWriter.setNull also writes a null to each field, so the field vectors stay as long as the struct vector.

Fixes #13715.

How was this patch tested?

Added ArrowVectorWriterTest: null ROW elements in an ARRAY and as MAP values, with primitive, ARRAY and nested ROW fields; a null ROW field inside a non-null element; and a top-level null ROW. They fail without the fix. Added a round trip through Velox to FlinkRowToVLVectorConvertorTest for an ARRAY with a null ROW element.

Was this patch authored or co-authored using generative AI tooling?

Yes. Generated-by: Claude Opus.

Copilot AI balanced review requested due to automatic review settings November 21, 2026 14:19

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added the FLINK label Nov 21, 2026
@LuciferYang

Copy link
Copy Markdown
Contributor Author

@KevinyhZou @lgbo-ustc Could you take a look? It's in ArrowVectorWriter, for a null ROW inside an ARRAY or MAP.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FLINK] A null ROW inside an ARRAY or MAP shifts the fields of the elements after it

2 participants