Uh oh!
There was an error while loading. Please reload this page.
[SPARK-7142][SQL]: Minor enhancement to BooleanSimplification Optimizer rule - #5700
[SPARK-7142][SQL]: Minor enhancement to BooleanSimplification Optimizer rule#5700saucam wants to merge 4 commits into
Conversation
SparkQA
commented
Apr 25, 2015
Test build #30953 has finished for PR 5700 at commit
|
There was a problem hiding this comment.
How these 2 rules optimize execution?
There was a problem hiding this comment.
So for example the filter is not(Or(left, r)) , where r might be some filter on a partitioned column like part>=12 , in the present case this filter cannot be pushed down, since while evaluating we will encounter reference of partitioned column, whereas if this rule is applied we get And(not(l), part<12) and then not(l) might be pushed down since now splitting into conjunctive predicates is possible.
There was a problem hiding this comment.
case Not(Or(l, r))? Seems you miss the Not...
There was a problem hiding this comment.
This is inside a case match :
case not @ Not(exp) => exp match {
....
....
case Or(l, r) => And(Not(l), Not(r))
}
There was a problem hiding this comment.
@cloud-fan could you please explain a bit more when and how converting to "And" may not be an optimization ? I was wondering would it actually result in any kind of performance hit ? Also could you tell how #8200 is more reasonable ?
There was a problem hiding this comment.
marmbrus
commented
Sep 3, 2015
Thanks for working on this! Can you please add test cases for these optimizations? |
…, using these rules: A and (not(A) or B) => A and B not(A and B) => not(A) or not(B) not(A or B) => not(A) and not(B)
saucam
commented
Sep 10, 2015
added test cases |
SparkQA
commented
Sep 10, 2015
Test build #42249 has finished for PR 5700 at commit
|
SparkQA
commented
Sep 10, 2015
Test build #42243 has finished for PR 5700 at commit
|
SparkQA
commented
Sep 10, 2015
Test build #42257 has finished for PR 5700 at commit
|
marmbrus
commented
Sep 10, 2015
Thanks, merging to master. |
saucam
commented
Sep 10, 2015
thanks @marmbrus :) |
There was a problem hiding this comment.
Do we need fastEquals here? Not(l) and l1 will never be a same reference and we always fallback to normal equality check. I think just here == here is more reasonable.
Use these in the optimizer as well: