Skip to content

Commit e2df118

Browse files
andygroveparthchandra
authored andcommitted
Add cast test
1 parent 16b2e94 commit e2df118

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

spark/src/test/scala/org/apache/comet/CometCastSuite.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,13 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper {
15941594
// CAST from TimestampNTZType
15951595

15961596
test("cast TimestampNTZType to StringType") {
1597-
castTest(generateTimestampNTZ(), DataTypes.StringType)
1597+
// TimestampNTZ is timezone-independent, so casting to string should produce
1598+
// the same result regardless of the session timezone.
1599+
for (tz <- representativeTimezones) {
1600+
withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> tz) {
1601+
castTest(generateTimestampNTZ(), DataTypes.StringType)
1602+
}
1603+
}
15981604
}
15991605

16001606
test("cast TimestampNTZType to DateType") {

0 commit comments

Comments
 (0)