Skip to content

Commit 91b2c26

Browse files
committed
address Michael's comment
1 parent 7eebf6d commit 91b2c26

File tree

1 file changed

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

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -473,14 +473,11 @@ object OptimizeIn extends Rule[LogicalPlan] {
473473
object CNFNormalization extends Rule[LogicalPlan] {
474474
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
475475
case q: LogicalPlan => q transformExpressionsUp {
476-
case or @ Or(left, right) => (left, right) match {
477-
// reverse Or with its And child to eliminate (And under Or) occurrence
478-
case (And(innerLhs, innerRhs), rhs) =>
479-
And(Or(innerLhs, rhs), Or(innerRhs, rhs))
480-
case (lhs, And(innerLhs, innerRhs)) =>
481-
And(Or(lhs, innerLhs), Or(lhs, innerRhs))
482-
case _ => or
483-
}
476+
// reverse Or with its And child to eliminate (And under Or) occurrence
477+
case Or(And(innerLhs, innerRhs), rhs) =>
478+
And(Or(innerLhs, rhs), Or(innerRhs, rhs))
479+
case Or(lhs, And(innerLhs, innerRhs)) =>
480+
And(Or(lhs, innerLhs), Or(lhs, innerRhs))
484481
}
485482
}
486483
}

0 commit comments

Comments
 (0)