-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache result of evaluating constraint per partition in iceberg #20304
Conversation
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergSplitSource.java
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergSplitSource.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergSplitSource.java
Outdated
Show resolved
Hide resolved
} | ||
Map<ColumnHandle, NullableValue> partitionValues = partitionValuesSupplier.get(); | ||
try { | ||
return partitionConstraintResults.get(ImmutableMap.copyOf(Maps.filterKeys(partitionValues, predicatePartitionColumns::contains))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the filtering of the partitionValues
map keys be a preparatory commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm only doing that to improve hit rate for cache when there are multiple partitioning columns and predicate is only on a subset of the partitioning columns.
I don't think we would get a benefit from doing this in the previous code.
Description
Currently we evaluate constraint on partitioning columns for every file in iceberg
split source. This change caches the result of constraint evaluation to avoid repeating
this computation for every file in a partition.
Additional context and related issues
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: