-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
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.