Skip to content

Commit

Permalink
[SPARK-7142] [SQL] Minor enhancement to BooleanSimplification Optimiz…
Browse files Browse the repository at this point in the history
…er rule. Incorporate review comments

Adding changes suggested by cloud-fan  in #5700

cc marmbrus

Author: Yash Datta <Yash.Datta@guavus.com>

Closes #8716 from saucam/bool_simp.
  • Loading branch information
Yash Datta authored and marmbrus committed Sep 11, 2015
1 parent d5d6473 commit 1eede3b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,10 @@ object BooleanSimplification extends Rule[LogicalPlan] with PredicateHelper {
// a && a => a
case (l, r) if l fastEquals r => l
// a && (not(a) || b) => a && b
case (l, Or(l1, r)) if (Not(l) fastEquals l1) => And(l, r)
case (l, Or(r, l1)) if (Not(l) fastEquals l1) => And(l, r)
case (Or(l, l1), r) if (l1 fastEquals Not(r)) => And(l, r)
case (Or(l1, l), r) if (l1 fastEquals Not(r)) => And(l, r)
case (l, Or(l1, r)) if (Not(l) == l1) => And(l, r)
case (l, Or(r, l1)) if (Not(l) == l1) => And(l, r)
case (Or(l, l1), r) if (l1 == Not(r)) => And(l, r)
case (Or(l1, l), r) if (l1 == Not(r)) => And(l, r)
// (a || b) && (a || c) => a || (b && c)
case _ =>
// 1. Split left and right to get the disjunctive predicates,
Expand Down

0 comments on commit 1eede3b

Please sign in to comment.