-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32509][SQL] Ignore unused DPP True Filter in Canonicalization #29318
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
Conversation
df019ce to
6cb0703
Compare
|
ok to test |
| output.map(QueryPlan.normalizeExpressions(_, output)), | ||
| requiredSchema, | ||
| QueryPlan.normalizePredicates(partitionFilters, output), | ||
| QueryPlan.normalizePredicates(filterUnnecessaryPredicates(partitionFilters), output), |
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.
Why does TrueLiteral affect canonicalize? TrueLiteral == TrueLiteral returns true, right?
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.
Ah I got it. Maybe one side has DPP and one side not.
Can we filter out DynamicPruningExpression(Literal.TrueLiteral)? Then we don't need to change https://github.com/apache/spark/pull/29318/files#diff-6c00f36fadec282fce72ad39cfea51caL81 and make this PR less risky.
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.
done.
|
Test build #126890 has finished for PR 29318 at commit
|
f59fb49 to
b1f8ba8
Compare
|
@cloud-fan Thanks for the review. I have made the required changes. |
|
Test build #126918 has finished for PR 29318 at commit
|
|
Test build #126917 has finished for PR 29318 at commit
|
|
Test build #126920 has finished for PR 29318 at commit
|
|
thanks, merging to master/3.0! |
### What changes were proposed in this pull request? This PR fixes issues relate to Canonicalization of FileSourceScanExec when it contains unused DPP Filter. ### Why are the changes needed? As part of PlanDynamicPruningFilter rule, the unused DPP Filter are simply replaced by `DynamicPruningExpression(TrueLiteral)` so that they can be avoided. But these unnecessary`DynamicPruningExpression(TrueLiteral)` partition filter inside the FileSourceScanExec affects the canonicalization of the node and so in many cases, this can prevent ReuseExchange from happening. This PR fixes this issue by ignoring the unused DPP filter in the `def doCanonicalize` method. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Added UT. Closes #29318 from prakharjain09/SPARK-32509_df_reuse. Authored-by: Prakhar Jain <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 7a09e71) Signed-off-by: Wenchen Fan <[email protected]>
|
@cloud-fan Thanks! |
What changes were proposed in this pull request?
This PR fixes issues relate to Canonicalization of FileSourceScanExec when it contains unused DPP Filter.
Why are the changes needed?
As part of PlanDynamicPruningFilter rule, the unused DPP Filter are simply replaced by
DynamicPruningExpression(TrueLiteral)so that they can be avoided. But these unnecessaryDynamicPruningExpression(TrueLiteral)partition filter inside the FileSourceScanExec affects the canonicalization of the node and so in many cases, this can prevent ReuseExchange from happening.This PR fixes this issue by ignoring the unused DPP filter in the
def doCanonicalizemethod.Does this PR introduce any user-facing change?
No
How was this patch tested?
Added UT.