@@ -383,15 +383,15 @@ object BooleanSimplification extends Rule[LogicalPlan] with PredicateHelper {
383
383
case (Literal (false , BooleanType ), r) => r
384
384
// l || false => l
385
385
case (l, Literal (false , BooleanType )) => l
386
- // a || b = a
386
+ // a || b => a
387
387
case (l, r) if l fastEquals r => l
388
388
// (a && b) || (a && c) => a && (b || c)
389
389
case _ =>
390
- // 1. Split left and right to get the conjunctive predicates,
391
- // i.e. lhsSet = (a, b), rhsSet = (a, c)
392
- // 2. Find the common predict between lhsSet and rhsSet, i.e. common = (a)
393
- // 3. Remove common predict from lhsSet and rhsSet, i.e. ldiff = (b), rdiff = (c)
394
- // 4. Apply the formula, get the optimized predicate: common && (ldiff || rdiff)
390
+ // 1. Split left and right to get the conjunctive predicates,
391
+ // i.e. lhsSet = (a, b), rhsSet = (a, c)
392
+ // 2. Find the common predict between lhsSet and rhsSet, i.e. common = (a)
393
+ // 3. Remove common predict from lhsSet and rhsSet, i.e. ldiff = (b), rdiff = (c)
394
+ // 4. Apply the formula, get the optimized predicate: common && (ldiff || rdiff)
395
395
val lhsSet = splitConjunctivePredicates(left).toSet
396
396
val rhsSet = splitConjunctivePredicates(right).toSet
397
397
val common = lhsSet.intersect(rhsSet)
0 commit comments