-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-13936] [SQL] Avoid Predicate Pushdown Using Constraints in PushPredicateThroughProject #11765
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
|
Test build #53328 has finished for PR 11765 at commit
|
|
Test build #53329 has finished for PR 11765 at commit
|
|
@gatorsmile Should we fix this in InferFiltersFromConstraints itself? |
|
@davies, changing |
|
@gatorsmile isn't the issue that you pointed out in the PR description just an artifact of union not propagating constraints correctly when it encounters a |
|
@sameeragarwal That is just an example that exposes this issue. I think |
|
Same, is this still an issue, active? |
|
The issue has been resolved. Let me close it. Thanks! |
What changes were proposed in this pull request?
In the query, Optimizer keeps adding duplicate constraints in Filter constraints by applying the rule PushPredicateThroughProject.
The generated optimized plan is like
Due to this issue, it also hits the max iteration, as shown in the log output https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/53176/consoleFull.
This PR uses the constraints to avoid pushing any predicate that already exists in its child's Constraints. Also, it will not pushing any predicate that does not contain any reference, since it could introduce the same issue.
Will introduce the same idea in the similar rules:
Should I do it in the same PR? or different PRs? @marmbrus
How was this patch tested?
Added a test case and also manually tested the case that causes the exception in #11714