wangyum commented on code in PR #36850:
URL: https://github.com/apache/spark/pull/36850#discussion_r973883554
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -205,10 +205,14 @@ object ConstantPropagation extends Rule[LogicalPlan] {
def replaceConstants0(expression: Expression) = expression transform {
case a: AttributeReference => constantsMap.getOrElse(a, a)
}
- condition transform {
- case e @ EqualTo(_, _) if !predicates.contains(e) => replaceConstants0(e)
- case e @ EqualNullSafe(_, _) if !predicates.contains(e) =>
replaceConstants0(e)
- }
+ splitConjunctivePredicates(condition).map {
+ // Don't replace constants in IsNotNull because
InferFiltersFromConstraints may infer
+ // another IsNotNull
+ case isNotNull: IsNotNull => isNotNull
+ case e: EqualTo if predicates.contains(e) => e
Review Comment:
OK
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]