harsh-ande commented on code in PR #26127:
URL: https://github.com/apache/datafusion/pull/26127#discussion_r4366411136


##########
datafusion/sqllogictest/test_files/spark/datetime/next_day.slt:
##########
@@ -100,3 +100,52 @@ query I
 SELECT arrow_cast(next_day(arrow_cast(95026230, 'Date32'), 'Tue'::string), 
'Int32');
 ----
 95026237
+
+# https://github.com/apache/datafusion/issues/23889
+# Spark casts the start date to DATE, so STRING and TIMESTAMP are accepted
+query D
+SELECT next_day('2015-07-23'::string, 'Mon'::string);
+----
+2015-07-27
+
+query D
+SELECT next_day('2015-07-23 12:12:12'::string, 'Mon'::string);
+----
+2015-07-27
+
+query D
+SELECT next_day('2015-07-23 12:12:12'::timestamp, 'Mon'::string);

Review Comment:
   Added the suggested pre-epoch timestamp case and verified it returns 
`1970-01-01`.



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