You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
The implementation uses the natural sort order of the underlying representation, in the absence of a clear alternative I think this is acceptable. Feel free to reopen if there is an alternative proposal
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 incorrectFor example two rows like
(month, days, nanos)
will be sortedEven 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.
The text was updated successfully, but these errors were encountered: