matthewalex4 commented on code in PR #3865:
URL: https://github.com/apache/datafusion-comet/pull/3865#discussion_r3065218265
##########
spark/src/test/scala/org/apache/comet/CometTemporalExpressionSuite.scala:
##########
@@ -489,4 +489,22 @@ class CometTemporalExpressionSuite extends CometTestBase
with AdaptiveSparkPlanH
dummyDF.selectExpr("unix_date(cast(NULL as date))"))
}
}
+
+ test("cast TimestampNTZ to Timestamp - DST edge cases") {
+ val data = Seq(
+ Row(java.time.LocalDateTime.parse("2024-03-31T01:30:00")), // Spring
forward (Europe/London)
+ Row(java.time.LocalDateTime.parse("2024-10-27T01:30:00")) // Fall back
(Europe/London)
+ )
+ val schema = StructType(Seq(StructField("ts_ntz",
DataTypes.TimestampNTZType, true)))
+ spark
+ .createDataFrame(spark.sparkContext.parallelize(data), schema)
+ .createOrReplaceTempView("dst_tbl")
+
+ withSQLConf(
+ SQLConf.SESSION_LOCAL_TIMEZONE.key -> "Europe/London",
+ "spark.comet.expression.Cast.allowIncompatible" -> "true") {
Review Comment:
Added in
[76e3977](https://github.com/apache/datafusion-comet/pull/3865/commits/76e3977e7936098da6f0935687b2ae2d5b45f5a5)
--
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]