-
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
Avoid dynamic filter current predicate computation when not used #9867
Avoid dynamic filter current predicate computation when not used #9867
Conversation
BooleanSupplier partitionMatchSupplier = () -> partitionMatches(partitionColumns, dynamicFilter.getCurrentPredicate(), hivePartition); | ||
BooleanSupplier partitionMatchSupplier = | ||
partitionColumns.stream().anyMatch(dynamicFilter.getColumnsCovered()::contains) | ||
? () -> true |
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 think this should the the other way around: if there is covering column then use partitionMatches(partitionColumns, dynamicFilter.getCurrentPredicate(), hivePartition)
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.
of course, you're correct.
this indicates some missing test coverage, since i just nuked a feature, and build is still green.
@raunaqmorarka @sopel39 do you have idea how this could be tested? can you test cover that?
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.
There is TestHiveDynamicPartitionPruningTest
but I guess it's not complete due to #5172
`DynamicFilter.getCurrentPredicate` is not free to call. Do not call it when results wouldn't be used. The edge case, where `getCurrentPredicate()` returns `TupleDomain.none()` is not worth optimizing for. In the future, it can be handled by the engine instead.
b6ff62d
to
a6a9056
Compare
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.
lgtm % but I would wait until DF part pruning tests are restored (which I plan todo)
@findepi dynamic partition pruning tests land. Do you want to rebase & merge? |
DynamicFilter.getCurrentPredicate
is not free to call. Do not call itwhen results wouldn't be used.
The edge case, where
getCurrentPredicate()
returnsTupleDomain.none()
is not worth optimizing for. In the future, it canbe handled by the engine instead.
cc @losipiuk @alexjo2144