Skip to content

Incorrect Sorting operations on MONTH_DAY_NANO interval type #1065 #1066

@alamb

Description

@alamb

Describe the bug
As pointed out by @jorgecarleitao and @b41sh on #779 (comment)

To Reproduce
Try and sort a MonthDayNano array and the ordering will likely be incorrect

For example two rows like (month, days, nanos) will be sorted

(1, 1, 0),
(0, 100, 0)

Even though the second row has 100 days and is longer than the first (a single month)

Expected behavior
It is not quite clear to me how arbitrary interval units should be sorted (because depending on the exact date, (1, 0, 0) and (0, 30, 0) will be ordered differently (as for example Feburary has 28 days typically and December has 31).

The expected behavior may be simply to say "can not sort this array" or require the user to provide their own custom cmp function where they can define how they want the arrays to be sorted.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrowChanges to the arrow cratebug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions