Omega359 commented on code in PR #19563: URL: https://github.com/apache/datafusion/pull/19563#discussion_r2658914538
########## datafusion/sqllogictest/test_files/datetime/dates.slt: ########## @@ -94,12 +94,20 @@ caused by Error during planning: Cannot coerce arithmetic expression Timestamp(ns) + Utf8 to valid types -# DATE minus DATE -# https://github.com/apache/arrow-rs/issues/4383 -query ? +# DATE minus DATE returns Int64 (days difference) +# This aligns with PostgreSQL, DuckDB, and MySQL behavior +# See: https://www.postgresql.org/docs/current/functions-datetime.html +query I SELECT DATE '2023-04-09' - DATE '2023-04-02'; ---- -7 days 0 hours 0 mins 0 secs +7 + +# Verify Date - Date returns Int64 type +query T +SELECT arrow_typeof(DATE '2023-04-09' - DATE '2023-04-02'); +---- +Int64 Review Comment: they are, though the arith_* files came in after these tests existed and I didn't noticed until after that PR had merged. -- 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]
