Omega359 opened a new issue, #19528:
URL: https://github.com/apache/datafusion/issues/19528

   ### Describe the bug
   
   As uncovered in https://github.com/apache/datafusion/pull/19460, `SELECT 
'2001-09-28'::date - '2001-08-12'::date` returns a Duration type whereas other 
systems return an int:
   
       https://www.postgresql.org/docs/current/functions-datetime.html
       
https://duckdb.org/docs/stable/sql/data_types/interval#arithmetic-with-timestamps-dates-and-intervals
       
https://dev.mysql.com/doc/refman/8.4/en/expressions.html#temporal-intervals
   
   Datafusion should adhere to common conventions for operation types unless 
there is a really good reason to deviate.
   
   IOW, this should work:
   
   query T
   SELECT arrow_typeof('2001-09-28'::date - '2001-08-12'::date)
   ----
   Int64
   
   ### To Reproduce
   
   See sql above
   
   ### Expected behavior
   
   date - date should return an int of the days difference between the two 
dates, not a duration.
   
   ### Additional context
   
   _No response_


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