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

Open
#13,715 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

@LuciferYang is already working on this.

Since Nov 21, 2026.

  • #13716 by @LuciferYang — open

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java, scala
Domain
data

Research direction

Start in FlinkRowToVLVectorConvertor.fromRowData and follow how ArrowVectorWriter delegates to BaseVectorWriter, focusing on the ROW field writers that only advance on non-null rows. Reproduce with an ARRAY<ROW<x INT, y STRING>> value containing a NULL element and check that later elements keep their fields aligned. Done when the array and map cases with null ROW values, and the nested r.x case, read back the correct values.

Written by the indexing model from the issue text.

Description

FlinkRowToVLVectorConvertor.fromRowData builds the Arrow vectors with ArrowVectorWriter. When it writes a null value, BaseVectorWriter only clears the validity bit. For a ROW, the field writers are advanced only when a non-null row is written, so after a null row each field vector is one row behind the struct vector.

A top-level column is written one row at a time, but array elements and map values go through one writer, so the shift shows up there. For an ARRAY<ROW<x INT, y STRING>> value [(1, 'a'), NULL, (2, 'b'), (3, 'c')], the element at index 2 reads back as (3, 'c'). A null ROW field inside a non-null element shifts the same way: for ARRAY<ROW<r ROW<x INT>>> with [(NULL), ((5))], the second element's r.x reads back as null.

v1.8.0-rc1 has the same code.

This issue was written with the assistance of AI (Claude Opus).

Dominant language
Scala
Stars
1.6k
Forks
679
Avg merge
4d 16h
Merged PRs (30d)
84

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/gluten

All issues in apache/gluten

Similar issues

More Scala issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.