-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-11979: Combine limit into SortOptions - REQUEST FOR COMMENT #9722
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
Conversation
| /// If Some(limit), only first `limit` elements in the sort order | ||
| /// in the output. Any data data after the limit will be | ||
| /// discarded. | ||
| pub limit: Option<usize>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the proposal
| assert_eq!(output, expected) | ||
| } | ||
|
|
||
| // TODO remove this function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will rewrite the tests properly (with a single SortOptions parameter) if people like this API change, but I didn't bother until I know it is worthwhile
|
@Dandandan I wonder if you have any comments on this approach |
|
I think that This is probably more evident in |
@jorgecarleitao that is a good point. Since the Arrow However, since lexsort and DataFusion sort use the same |
Totally agree with that.
There are 2 sort_options, yet the limit is the only one for the global results. |
|
I am convinced that this PR is not a good idea at this time. Closing. Thanks for the feedback @sundy-li and @jorgecarleitao 👍 |
The
sort_limitkernel was added by @sundy-li in #9602While writing some doc examples in #9721, it occured to me we could potentially simplify the API so I figured I would offer a proposed PR for comment
Rationale
Since we already have a
SortOptionsstructure that controls sorting options, we could also add thelimitto that structure rather than adding a newsort_limitfunction and still avoid changing the APIChanges
Move the
limitoption toSortOptions