MaxGekk commented on code in PR #41010:
URL: https://github.com/apache/spark/pull/41010#discussion_r1182114437


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CanonicalizeSuite.scala:
##########
@@ -99,6 +99,18 @@ class CanonicalizeSuite extends SparkFunSuite {
     assert(castWithTimeZoneId.semanticEquals(cast))
   }
 
+  test("SPARK-43336: Canonicalize Cast between Timestamp and TimestampNTZ 
should consider " +
+    "timezone") {
+    val timestampLiteral = Literal.create(1L, TimestampType)
+    val timestampNTZLiteral = Literal.create(1L, TimestampNTZType)
+    Seq(
+      Cast(timestampLiteral, TimestampNTZType),
+      Cast(timestampNTZLiteral, TimestampType)
+    ).foreach { cast =>
+      
assert(!cast.semanticEquals(cast.withTimeZone(TimeZone.getDefault.getID)))

Review Comment:
   Using JVM timezone could make the test unstable, can you use the current 
time zone from the session time zone config.



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