wangyum commented on code in PR #40190:
URL: https://github.com/apache/spark/pull/40190#discussion_r1129431132


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/UnwrapCastInBinaryComparison.scala:
##########
@@ -361,6 +395,7 @@ object UnwrapCastInBinaryComparison extends 
Rule[LogicalPlan] {
     case (IntegerType, FloatType) => false
     case (LongType, FloatType) => false
     case (LongType, DoubleType) => false
+    case (TimestampType | TimestampNTZType, DateType) => true

Review Comment:
    have moved the logic to a new function: `needToCanonicalizeExpression`.



##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/UnwrapCastInBinaryComparisonSuite.scala:
##########
@@ -368,6 +370,61 @@ class UnwrapCastInBinaryComparisonSuite extends PlanTest 
with ExpressionEvalHelp
     assertEquivalent(castInt(f4) < t, trueIfNotNull(f4))
   }
 
+  test("SPARK-42597: Support unwrap date to timestamp type") {

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: 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

Reply via email to