Improve logic for reading dictionaries during row group pruning#14247
Merged
raunaqmorarka merged 5 commits intotrinodb:masterfrom Sep 24, 2022
Merged
Improve logic for reading dictionaries during row group pruning#14247raunaqmorarka merged 5 commits intotrinodb:masterfrom
raunaqmorarka merged 5 commits intotrinodb:masterfrom
Conversation
When the nulls count in column statistics for a column is 0, we can use that for setting nullAllowed to false in parquet dictionary domains
skrzypo987
reviewed
Sep 22, 2022
lib/trino-parquet/src/main/java/io/trino/parquet/predicate/Predicate.java
Outdated
Show resolved
Hide resolved
lib/trino-parquet/src/main/java/io/trino/parquet/predicate/TupleDomainParquetPredicate.java
Outdated
Show resolved
Hide resolved
e767bb9 to
80bd124
Compare
Perform column index and dictionary lookups only for the subset of columns where it can be useful. This prevents unnecessary filesystem reads and decoding work when the predicate on a column comes from a connector's file-level min/max stats or more generally when the predicate selects a domain equal to or wider than row-group min/max.
Limits the size of the filesystem read to only the required length when fetching dictionary for row-group pruning in parquet
80bd124 to
184dc6d
Compare
sopel39
approved these changes
Sep 23, 2022
Member
sopel39
left a comment
There was a problem hiding this comment.
Do you think we should introduce feature flag for optimized reader first?
| @@ -21,11 +21,13 @@ | |||
| public class DictionaryDescriptor | |||
Member
There was a problem hiding this comment.
When the nulls count in column statistics for a column is 0
Do you think it's possible for some writer to set it incorrectly?
Member
Author
There was a problem hiding this comment.
If column statistics are incorrect then our existing predicate pushdown logic could also give wrong results, so we should be able to rely on it
Member
Author
These are targeted fixes/improvements in existing code and not a rewrite of the reader, so these shouldn't need to be behind a flag |
Closed
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.
Description
Improve logic for reading dictionaries during row group pruning in parquet reader
Non-technical explanation
Improves parquet reader performance in the presence of predicates.
Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text: