You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "wangyum (via GitHub)" <gi...@apache.org> on 2023/04/12 14:33:38 UTC

[GitHub] [spark] wangyum commented on a diff in pull request #40743: [SPARK-42597][SQL][FOLLOW-UP] Exclude `EqualNullSafe` when unwrapping date type to timestamp type

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


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/UnwrapCastInBinaryComparisonSuite.scala:
##########
@@ -392,9 +392,8 @@ class UnwrapCastInBinaryComparisonSuite extends PlanTest with ExpressionEvalHelp
       (f5 >= castTimestamp(dateLit) && f5 < castTimestamp(dateAddOne)) ||
         (f6 >= castTimestampNTZ(dateLit) && f6 < castTimestampNTZ(dateAddOne)))
     assertEquivalent(
-      castDate(f5) <=> dateLit || castDate(f6) === dateLit,
-      (f5 >= castTimestamp(dateLit) && f5 < castTimestamp(dateAddOne)) ||
-        (f6 >= castTimestampNTZ(dateLit) && f6 < castTimestampNTZ(dateAddOne)))
+      castDate(f5) <=> dateLit || castDate(f6) <=> dateLit,
+      (f5 >= castTimestamp(dateLit) && f5 < castTimestamp(dateAddOne)) || castDate(f6) <=> dateLit)

Review Comment:
   timestamp is non nullable and timestampNTZ is null able.
   `castDate(f5) <=> dateLit` test non nullable and `castDate(f6) <=> dateLit` test nullable.



-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org