andygrove commented on code in PR #3145:
URL: https://github.com/apache/datafusion-comet/pull/3145#discussion_r2692901930
##########
spark/src/test/scala/org/apache/comet/CometTemporalExpressionSuite.scala:
##########
@@ -122,4 +122,38 @@ class CometTemporalExpressionSuite extends CometTestBase
with AdaptiveSparkPlanH
StructField("fmt", DataTypes.StringType, true)))
FuzzDataGenerator.generateDataFrame(r, spark, schema, 1000,
DataGenOptions())
}
+
+ test("datediff") {
Review Comment:
Good suggestion! I've added leap year edge case tests:
- `datediff('1900-03-01', '1900-02-27')` = 2 days (1900 was NOT a leap year
- divisible by 100 but not 400)
- `datediff('2000-03-01', '2000-02-27')` = 3 days (2000 WAS a leap year -
divisible by 400)
- `datediff('2004-03-01', '2004-02-28')` = 2 days (2004 was a leap year -
divisible by 4, not by 100)
- `datediff('2100-03-01', '2100-02-28')` = 1 day (2100 will NOT be a leap
year - divisible by 100 but not 400)
All tests pass.
--
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]