Conversation
nssalian
force-pushed
the
arrow-vect-nested-types
branch
from
September 15, 2026 05:02
13b5383 to
172d631
Compare
Contributor
Collaborator
Author
|
Thanks for linking me to that PR @pvary. I missed it but I did take a look at the implementation. The PR stops at the arrow layer (no Spark StructColumnVector/SparkBatch changes) and uses an all-children-null heuristic for null structs, so it's incomplete for the Spark vectorized path from my vantage point. I'm fixing the test failures in this PR hence it is still in draft as I work through. Let me push up the changes to get it in a clean state and we can review it once that is done. |
nssalian
force-pushed
the
arrow-vect-nested-types
branch
2 times, most recently
from
September 16, 2026 23:45
852dc60 to
409c063
Compare
nssalian
force-pushed
the
arrow-vect-nested-types
branch
from
September 17, 2026 18:27
409c063 to
f3d1ebb
Compare
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.
Rationale
Vectorized Parquet reads currently throw
UnsupportedOperationExceptionfor struct columns, so any scan that projects a struct falls back to the row reader. This adds vectorized struct reads for Spark 3.5, 4.0, 4.1, and 4.2.A struct is assembled from its child column vectors. Whether a struct is null is decided per row from the definition level of a real leaf under it, matching the row reader - including the schema-evolution case where a struct is projected with only a field that isn't in the file (present rows return the struct with that field null; rows where the struct was null return null). Nested structs share a single presence read, and a struct whose projected leaf is a partition constant reads present without re-reading a column. ORC and Avro are unchanged.
The standalone
ArrowReaderstill rejects structs (SUPPORTED_TYPES); that path needs a fully materialized ArrowStructVectorand is left as a follow-up. Flink has no arrow vectorized-Parquet path, so it is unaffected. Related to #2485.Changes
VectorizedReaderBuilder.structbuilds aVectorizedStructReader; presence is populated from a definition-level hook in the column/page/def-level readers.ParquetSchemaUtil.selectPresenceColumnandpresenceFieldare now public (used by the arrow reader to pick the same presence leaf the row reader retains). New public API iniceberg-parquet; non-breaking, no revapi entry needed.StructColumnVector, dispatch it inColumnVectorBuilder, and allow structs inSparkBatch. The unshredded-variant lower-bounds check now also covers variants nested inside a struct.Chose to do all the Spark versions together, since the struct reader lives in the shared arrow/parquet modules with no per-version switch, so enabling only one version leaves the others' existing nested-struct tests failing on the vectorized path.
Tests
Per Spark version: nested / nullable / multi-level / dictionary-encoded / all-null structs, projection of an added field (per-row null), and structs under position deletes. Arrow unit tests cover child-holder assembly, presence-leaf resolution, and nested presence-reader reuse.
AI Disclosure