-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
As uncovered in #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
kumarUjjawal
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working