Skip to content

INTERVAL ... SQL syntax produces inconsistent types #5801

Description

@alamb

The same SQL syntax

interval '5 months'
interval '5 days 3 nanoseconds'

Produces two different data types.

select   arrow_typeof(interval '5 months'),
  arrow_typeof(interval '5 days 3 nanoseconds')
;
+-------------------------------------+-----------------------------------------------------------+
| arrowtypeof(IntervalYearMonth("5")) | arrowtypeof(IntervalMonthDayNano("92233720368547758083")) |
+-------------------------------------+-----------------------------------------------------------+
| Interval(YearMonth)                 | Interval(MonthDayNano)                                    |
+-------------------------------------+-----------------------------------------------------------+

I would like it it to produce the same datatype always (in this case IntervalMonthDayNano) so that it has the same type as the SQL INTERVAL typed, added in #5792

this is inconsistent with '5 days 3 nanoseconds'::interval, an explicit cast to interval.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions