parquet: decoder-level dictionary filter pushdown for Parquet reader#9464
Draft
lyang24 wants to merge 1 commit intoapache:mainfrom
Draft
parquet: decoder-level dictionary filter pushdown for Parquet reader#9464lyang24 wants to merge 1 commit intoapache:mainfrom
lyang24 wants to merge 1 commit intoapache:mainfrom
Conversation
0116686 to
2629604
Compare
Push predicate evaluation into the decoder for dictionary-encoded BYTE_ARRAY columns. Instead of decoding all rows into StringViewArray and then filtering, this evaluates the predicate once on the small dictionary (~N unique values), then maps integer keys to booleans via a simple lookup — no intermediate arrays are created for data rows. Two-phase approach: - Phase 1: decode dictionary page, evaluate predicate, produce matching_keys: Vec<bool> per row group - Phase 2: DictFilterDecoder reads RLE-encoded integer keys and maps each key to matching_keys[key], producing a BooleanArray that feeds directly into RowSelection Adds ArrowPredicate::use_dictionary_encoding() opt-in flag and falls back to the normal path for multi-column predicates, non-BYTE_ARRAY types, nested columns, or PLAIN-encoded pages.
2629604 to
a4545dd
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.
Which issue does this PR close?
Rationale for this change
for columns that is dictionary encoded
we use to turn dictionary encoding into StringViewArray then we compare against the filter
What changes are included in this PR?
for a column that is 100% dictionary encoded
we decode the dictionary keys, then apply filter, then expand the nulls, at last we filter the value and only materialize those who survived the filter.
Are these changes tested?
existing test should pass added additional tests
Are there any user-facing changes?
yes added an new api with_dict_pushdown to opt in to enable the predicate pushdown on predicates