-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21652][SQL] Fix rule confliction between InferFiltersFromConstraints and ConstantPropagation #19099
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
|
cc @gatorsmile |
|
Test build #81299 has finished for PR 19099 at commit
|
| PushProjectionThroughUnion, | ||
| ReorderJoin, | ||
| EliminateOuterJoin, | ||
| InferFiltersFromConstraints, |
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 you changed this?
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 is not ideal, but it should resolve the specific failure case and could unblock other PR.
@gatorsmile is working on an alter approach that should perfectly resolve the entire issue of add/remove filters, but it takes time and I don't think it will be ready in a few days.
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.
Basically, this is to infer the filters at the beginning of this huge batch, and then remove the useless at the end. When it involves multiple rules, we might still hit the max iteration. Eventually, we need a clean fix to split the whole batch to two separate ones. One is to add the filters/constraints; another is to remove the filters/constraints based on the costs.
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.
aha, thanks for the explanation~
| } | ||
|
|
||
| test("SPARK-21652: rule confliction of InferFiltersFromConstraints and ConstantPropagation") { | ||
| // Under test environment, throws Exception if the max iteration number is reached for an |
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.
Just catching the exception is not enough for this test?
|
Test build #81322 has finished for PR 19099 at commit
|
|
Test build #81323 has finished for PR 19099 at commit
|
|
retest this please |
|
Test build #81418 has finished for PR 19099 at commit
|
|
LGTM |
|
Thanks! Merging to master. |
What changes were proposed in this pull request?
For the given example below, the predicate added by
InferFiltersFromConstraintsis folded byConstantPropagationlater, this leads to unconverged optimize iteration:We can fix this by adjusting the indent of the optimize rules.
How was this patch tested?
Add test case that would have failed in
SQLQuerySuite.