-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[BugFix] Fix mv partition prune failed when partition column predicate with function #46786
Conversation
7351d93
to
8eb2438
Compare
…e with function Signed-off-by: kaijian.ding <[email protected]>
Quality Gate passedIssues Measures |
[FE Incremental Coverage Report]✅ pass : 2 / 2 (100.00%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
@@ -408,6 +409,8 @@ private static boolean isNeedFurtherPrune(List<Long> candidatePartitions, Logica | |||
return (FunctionSet.DATE_TRUNC.equalsIgnoreCase(functionName) | |||
|| FunctionSet.TIME_SLICE.equalsIgnoreCase(functionName)) | |||
&& !exprPartitionInfo.getIdToRange(true).containsKey(candidatePartitions.get(0)); | |||
} else if (partitionExpr.size() == 1 && partitionExpr.get(0) instanceof SlotRef) { | |||
return !exprPartitionInfo.getIdToRange(true).containsKey(candidatePartitions.get(0)); |
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.
Can we handle all partition exprs? eg: date_trunc/str2date/cast?
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.
This pr is to make partition prune behavior consisitent to base table and mv, eg: date_format
can be used to prune partition to base table, but not to mv.
Currently, it's consistent for base table and mv on these 3 functions:
date_trunc
can apply partition prune to base table and mvstr2date
can't apply partition prune to base table and mvcast
can't apply partition prune to base table and mv
We can add partition prune support to str2date/cast
in another pr.
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 got your meaning. So this pr only optimizes partition pruning with slot ref
partitions.
@Mergifyio backport branch-3.3 |
✅ Backports have been created
|
…e with function (#46786) Signed-off-by: kaijian.ding <[email protected]> (cherry picked from commit 77a35fd)
…e with function (backport #46786) (#49608) Co-authored-by: kaijianding <[email protected]>
Why I'm doing:
What I'm doing:
Fixes #46785
What type of PR is this:
Does this PR entail a change in behavior?
Checklist:
Bugfix cherry-pick branch check: