comphead commented on code in PR #6348:
URL: https://github.com/apache/datafusion-comet/pull/6348#discussion_r4146851153


##########
spark/src/test/scala/org/apache/comet/CometTemporalExpressionSuite.scala:
##########
@@ -823,8 +823,8 @@ class CometTemporalExpressionSuite extends CometTestBase 
with AdaptiveSparkPlanH
                 java.sql.Timestamp.valueOf("2024-06-15 10:30:00"),
                 DataTypes.TimestampType)))),
         dummyDF.selectExpr(
-          "unix_date(cast(TIMESTAMP('1970-01-01 00:00:00') as date))",
-          "unix_date(cast(TIMESTAMP('2024-06-15 10:30:00') as date))"))
+          "cast(floor(unix_micros(TIMESTAMP('1970-01-01 00:00:00')) / 
86400000000D) as int)",
+          "cast(floor(unix_micros(TIMESTAMP('2024-06-15 10:30:00')) / 
86400000000D) as int)"))

Review Comment:
   Nit: this block uses the default session zone (I'd expect UTC on CI), so it 
probably passes with the old serde too, and no timestamp in the `days` tests is 
before 1970 (the fuzz data sit around year 3333). Would it make sense to add 
one check under `Asia/Tokyo` with a pre-epoch instant built from micros, such 
as `Days(Literal(-1L, DataTypes.TimestampType))` with expected `-1`? The old 
serde should return `0` there, and it would pin flooring for negative values.



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

Reply via email to