wangyum commented on code in PR #40190: URL: https://github.com/apache/spark/pull/40190#discussion_r1119729827
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/UnwrapCastInBinaryComparison.scala: ########## @@ -133,6 +133,12 @@ object UnwrapCastInBinaryComparison extends Rule[LogicalPlan] { if canImplicitlyCast(fromExp, toType, literalType) => simplifyNumericComparison(be, fromExp, toType, value) + case be @ BinaryComparison( + Cast(fromExp, _, timeZoneId, evalMode), date @ Literal(value, DateType)) + if (fromExp.dataType == TimestampType || fromExp.dataType == TimestampNTZType) && + value != null => Review Comment: null literal should be handled by `NullPropagation`. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org