Uh oh!
There was an error while loading. Please reload this page.
[SPARK-4937][SQL] Normalizes conjunctions and disjunctions to eliminate common predicates - #3784
[SPARK-4937][SQL] Normalizes conjunctions and disjunctions to eliminate common predicates#3784liancheng wants to merge 5 commits into
Conversation
SparkQA
commented
Dec 24, 2014
Test build #24762 has started for PR 3784 at commit
|
SparkQA
commented
Dec 24, 2014
Test build #24762 has finished for PR 3784 at commit
|
AmplabJenkins
commented
Dec 24, 2014
Test FAILed. |
SparkQA
commented
Dec 24, 2014
Test build #24763 has started for PR 3784 at commit
|
SparkQA
commented
Dec 24, 2014
Test build #24764 has started for PR 3784 at commit
|
SparkQA
commented
Dec 24, 2014
Test build #24763 has finished for PR 3784 at commit
|
AmplabJenkins
commented
Dec 24, 2014
Test FAILed. |
SparkQA
commented
Dec 24, 2014
Test build #24764 has finished for PR 3784 at commit
|
AmplabJenkins
commented
Dec 24, 2014
Test FAILed. |
SparkQA
commented
Dec 24, 2014
Test build #24776 has started for PR 3784 at commit
|
3cf7937 to
0e51101CompareSparkQA
commented
Dec 24, 2014
Test build #24777 has started for PR 3784 at commit
|
0e51101 to
4ab3a58CompareSparkQA
commented
Dec 24, 2014
Test build #24779 has started for PR 3784 at commit
|
SparkQA
commented
Dec 24, 2014
Test build #24776 has finished for PR 3784 at commit
|
AmplabJenkins
commented
Dec 24, 2014
Test PASSed. |
SparkQA
commented
Dec 24, 2014
Test build #24777 has finished for PR 3784 at commit
|
AmplabJenkins
commented
Dec 24, 2014
Test PASSed. |
SparkQA
commented
Dec 24, 2014
Test build #24779 has finished for PR 3784 at commit
|
AmplabJenkins
commented
Dec 24, 2014
Test PASSed. |
There was a problem hiding this comment.
f.transformExpressionUp instead? And this rule also can be applied to the normal expressions, not just only for expression in Filter. Move this into BooleanSimplification?
There was a problem hiding this comment.
Ah, f.transformExpressionUp is really a good idea! Moving to BooleanSimplification also makes sense. Thanks for the suggestions :)
chenghao-intel
commented
Dec 25, 2014
This is really helpful optimization, and the implementation makes sense to me, and it would be great if we apply the rules for the those non |
SparkQA
commented
Dec 25, 2014
Test build #24815 has started for PR 3784 at commit
|
00aaa63 to
f4d9b8fCompareSparkQA
commented
Dec 25, 2014
Test build #24816 has started for PR 3784 at commit
|
f4d9b8f to
601d5f6CompareSparkQA
commented
Dec 25, 2014
Test build #24817 has started for PR 3784 at commit
|
SparkQA
commented
Dec 25, 2014
Test build #24815 has finished for PR 3784 at commit
|
AmplabJenkins
commented
Dec 25, 2014
Test PASSed. |
SparkQA
commented
Dec 25, 2014
Test build #24816 has finished for PR 3784 at commit
|
AmplabJenkins
commented
Dec 25, 2014
Test PASSed. |
SparkQA
commented
Dec 25, 2014
Test build #24817 has finished for PR 3784 at commit
|
AmplabJenkins
commented
Dec 25, 2014
Test PASSed. |
scwf
commented
Dec 25, 2014
Hi @liancheng, i admit my PR is more complicated, but this only cover three cases, i think we'd better adding a separate rule to optimize And/Or in sql for as many as possible cases, not mix several cases in BooleanSimplification. So I am refactorying my PR to make it more readable and clean. |
601d5f6 to
caca560CompareSparkQA
commented
Dec 25, 2014
Test build #24821 has started for PR 3784 at commit
|
SparkQA
commented
Dec 25, 2014
Test build #24821 has finished for PR 3784 at commit
|
AmplabJenkins
commented
Dec 25, 2014
Test PASSed. |
scwf
commented
Dec 26, 2014
Hi, @liancheng, my PR originally also not limited to Filter, i used |
liancheng
commented
Dec 27, 2014
marmbrus
commented
Dec 30, 2014
Thanks! I've merged this to master. |
This PR is a simplified version of several filter optimization rules introduced in #3778 authored by @scwf. Newly introduced optimizations include:
a && a=>aa || a=>a(a || b || c || ...) && (a || b || d || ...)=>a && b && (c || d || ...)The 3rd rule is particularly useful for optimizing the following query, which is planned into a cartesian product
to the following one, which is planned into an equi-join:
The example above is quite artificial, but common predicates are likely to appear in real life complex queries (like the one mentioned in #3778).
A difference between this PR and #3778 is that these optimizations are not limited to
Filter, but are generalized to all logical plan nodes. Thanks to @scwf for bringing up these optimizations, and @chenghao-intel for the generalization suggestion.