Omega359 commented on code in PR #19460:
URL: https://github.com/apache/datafusion/pull/19460#discussion_r2643558273


##########
datafusion/sqllogictest/test_files/datetime/arith_date_interval.slt:
##########
@@ -0,0 +1,27 @@
+# date + interval → timestamp
+# Add an interval to a date
+# date '2001-09-28' + interval '1 hour' → 2001-09-28 01:00:00
+
+query D
+SELECT '2001-09-28'::date + interval '1 hour'
+----
+2001-09-28

Review Comment:
   This is an interesting one. Arrow does Date + interval => date 
([types.rs](https://github.com/apache/arrow-rs/blob/addf74d72d88684dabac21822c22f35e803135c5/arrow-array/src/types.rs#L961)).
 
   
   This works as expected for date + int (in pg and for datafusion the int is 
days) as I transform that to date + interval (as arrow doesn't support date + 
int) however it's not what is really expected here.
   
   I'll see if I can cast the date + interval to timestamp + interval which 
should result in the expected output.
   



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