feat: push down IS NULL / IS NOT NULL on struct columns into Parquet scan#21796
Open
Druva-D wants to merge 1 commit intoapache:mainfrom
Open
feat: push down IS NULL / IS NOT NULL on struct columns into Parquet scan#21796Druva-D wants to merge 1 commit intoapache:mainfrom
Druva-D wants to merge 1 commit intoapache:mainfrom
Conversation
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.
Which issue does this PR close?
Rationale for this change
IS NULL/IS NOT NULLon struct columns is blanket-rejected from Parquet row filter pushdown, forcing all leaf columns to be materialized post-scan just to check nullability. In Parquet, definition levels encode struct nullability independently — arrow-rs reconstructs the struct's null bitmap from any single leaf. This PR exploits that to push down struct null checks while reading only one leaf column.SELECT id WHERE s IS NOT NULLSELECT * WHERE s IS NOT NULLThe speedup applies when the struct is filtered but not projected.
SELECT *shows no benefit since all leaves are read for the output anyway.What changes are included in this PR?
IS NULL(Column(struct))/IS NOT NULL(Column(struct))inPushdownChecker::f_downbefore the Column node triggers the blanket struct rejectionresolve_struct_null_check_leaves(). Merge the first leaf path into field access paths inbuild_filter_schemato avoid schema/mask mismatch when combined withget_fieldin OR expressionsstruct_data_structures_prevent_pushdown→struct_is_not_null_allows_pushdown(assertion flipped — struct null checks are now supported)Are these changes tested?
Yes — 10 unit tests (pushdown acceptance, correctness with all-null leaves, nested structs, OR expressions with combined null check + field access, NOT wrapping), plus an integration test verifying
pushdown_rows_pruned/pushdown_rows_matchedmetrics through the fullSessionContextpipeline.Tests generated with the help of Claude Code
Are there any user-facing changes?
No. Struct null check pushdown activates automatically when
pushdown_filtersis enabled.