Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit f2ee5fe

Browse files
committed
Update Optimizer.scala
1 parent be6b1d5 commit f2ee5fe

File tree

1 file changed

+6
-6
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer

1 file changed

+6
-6
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,15 @@ object BooleanSimplification extends Rule[LogicalPlan] with PredicateHelper {
383383
case (Literal(false, BooleanType), r) => r
384384
// l || false => l
385385
case (l, Literal(false, BooleanType)) => l
386-
// a || b = a
386+
// a || b => a
387387
case (l, r) if l fastEquals r => l
388388
// (a && b) || (a && c) => a && (b || c)
389389
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)
395395
val lhsSet = splitConjunctivePredicates(left).toSet
396396
val rhsSet = splitConjunctivePredicates(right).toSet
397397
val common = lhsSet.intersect(rhsSet)

0 commit comments

Comments
 (0)