2010YOUY01 commented on code in PR #16828: URL: https://github.com/apache/datafusion/pull/16828#discussion_r2227274568
########## datafusion/sqllogictest/test_files/spark/datetime/last_day.slt: ########## @@ -21,7 +21,80 @@ # For more information, please see: # https://github.com/apache/datafusion/issues/15914 -## Original Query: SELECT last_day('2009-01-12'); -## PySpark 3.5.5 Result: {'last_day(2009-01-12)': datetime.date(2009, 1, 31), 'typeof(last_day(2009-01-12))': 'date', 'typeof(2009-01-12)': 'string'} -#query -#SELECT last_day('2009-01-12'::string); +query D +SELECT last_day('2009-01-12'::string); +---- +2009-01-31 + + +query D +SELECT last_day('2015-02-28'::string); +---- +2015-02-28 + +query D +SELECT last_day('2015-03-27'::string); +---- +2015-03-31 + +query D +SELECT last_day('2015-04-26'::string); +---- +2015-04-30 + +query D +SELECT last_day('2015-05-25'::string); +---- +2015-05-31 + +query D +SELECT last_day('2015-06-24'::string); +---- +2015-06-30 + +query D +SELECT last_day('2015-07-23'::string); +---- +2015-07-31 + +query D +SELECT last_day('2015-08-01'::string); +---- +2015-08-31 + +query D +SELECT last_day('2015-09-02'::string); +---- +2015-09-30 + +query D +SELECT last_day('2015-10-03'::string); +---- +2015-10-31 + +query D +SELECT last_day('2015-11-04'::string); +---- +2015-11-30 + +query D +SELECT last_day('2015-12-05'::string); +---- +2015-12-31 + + +query D +SELECT last_day('2016-01-06'::string); +---- +2016-01-31 + +query D +SELECT last_day('2016-02-07'::string); +---- +2016-02-29 + + +query ? +SELECT NULL; Review Comment: Yes, given these two error messages are expected, so we can ensure the coercions are handled automatically. BTW you can also add these error cases to slt like https://github.com/apache/datafusion/blob/main/datafusion/sqllogictest/test_files/aggregate.slt#L135-L136 Otherwise this PR LGTM -- 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]
