File tree Expand file tree Collapse file tree 1 file changed +2
-20
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer Expand file tree Collapse file tree 1 file changed +2
-20
lines changed Original file line number Diff line number Diff line change @@ -115,26 +115,8 @@ object ConstantPropagation extends Rule[LogicalPlan] with PredicateHelper {
115115 And (replacedNewLeft, replacedNewRight)
116116 }
117117 (newAnd, equalityPredicatesLeft ++= equalityPredicatesRight)
118- case o @ Or (left, right) =>
119- // Ignore the EqualityPredicates from children since they are only propagated through And.
120- val (newLeft, _) = traverse(left)
121- val (newRight, _) = traverse(right)
122- val newOr = if ((newLeft fastEquals left) && (newRight fastEquals right)) {
123- o
124- } else {
125- Or (newLeft, newRight)
126- }
127-
128- (newOr, Map .empty)
129- case n @ Not (child) =>
130- // Ignore the EqualityPredicates from children since they are only propagated through And.
131- val (newChild, _) = traverse(child)
132- val newNot = if (newChild fastEquals child) {
133- n
134- } else {
135- Not (newChild)
136- }
137- (newNot, Map .empty)
118+ case o @ (_ : Or | _ : Not ) =>
119+ (o.mapChildren(traverse(_)._1), Map .empty)
138120 case _ => (expression, Map .empty)
139121 }
140122
You can’t perform that action at this time.
0 commit comments