Repository navigation
fix(arrow): use Parquet leaf indices for projection - #3624
darshpatel1052 wants to merge 4 commits into
Conversation
JeonDaehong
left a comment
There was a problem hiding this comment.
I checked the missing-column side of this, since dropping the ProjectionMask::all() fallback changes what gets read when every projected column is absent. Projecting only a column the file doesn't have, with positional deletes ([1] and [0,2]), a filter on a present column, both, and b IS NULL, on one and on three row groups: row counts and the all-null values match main in every case, and the reader tests pass.
|
Merged the latest The Parquet leaf-index mapping is preserved, along with the missing-column projection behavior. I also reran the full Thanks @JeonDaehong for checking the missing-column cases as well! |
JeonDaehong
left a comment
There was a problem hiding this comment.
Re-ran the missing-column checks on 619cb88 after the merge with #3438. Projecting only b, which the file doesn't have, gives the same rows as main in every case: with positional deletes [1] and [0,2], a > 2, b IS NULL and b IS NOT NULL, on 1 and 3 row groups. The arrow:: tests, including the struct presence ones, pass too. LGTM, thanks @darshpatel1052!

Which issue does this PR close?
What changes are included in this PR?
This PR fixes incorrect Parquet column projection and predicate lookup caused by relying on Arrow's leaf numbering, which can differ from the actual Parquet column order for nested types such as
ListViewandLargeListView.The changes include:
Fields::filter_leaves, ensuring projection masks select the correct physical columns.ListViewandLargeListViewelements during schema mapping and projected-field collection.ProjectionMask::all()when no requested columns exist in the file. This prevents unrelated file values from being returned under newly added column names.Are these changes tested?
Added and extended regression tests covering:
test_projection_after_nested_list_view: Tests nested lists with multiple element leaves, including regular/large lists and list views, with embedded field IDs and name mapping. Covers projection and predicate filtering through row-group, bloom-filter, and page-index configurations.test_name_mapping_parquet_list_encodings: Verifies correct leaf indices across different Parquet list encodings, including legacy repeated fields.test_schema_evolution_add_column: Verifies that existing data is preserved while missing columns return NULLs or their configured initial defaults, including projections containing only absent fields.The reader-level regression tests also exercise the related pipeline and record-batch transformation changes.
AI Disclosure
OpenAI Codex (GPT-6.1 Sol, xhigh reasoning effort) assisted with regression-test development, and code review. I reviewed the resulting changes and take responsibility for their correctness.