gengliangwang commented on code in PR #41010:
URL: https://github.com/apache/spark/pull/41010#discussion_r1182119710
##########
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:
I am following the test case from
https://github.com/apache/spark/commit/ca90e1932dcdc43748297c627ec857b6ea97dff7.
It is comparing `None` with a default defined time zone, so probably it is
fine.
--
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]