Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Sorting operations on MONTH_DAY_NANO interval type #1065 #1066

Closed
alamb opened this issue Dec 20, 2021 · 1 comment
Closed

Incorrect Sorting operations on MONTH_DAY_NANO interval type #1065 #1066

alamb opened this issue Dec 20, 2021 · 1 comment
Labels
arrow Changes to the arrow crate bug

Comments

@alamb
Copy link
Contributor

alamb commented Dec 20, 2021

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.

@tustvold
Copy link
Contributor

tustvold commented Jun 1, 2023

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

@tustvold tustvold closed this as completed Jun 1, 2023
@tustvold tustvold closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate bug
Projects
None yet
Development

No branches or pull requests

2 participants