-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Minor: use the minimum fetch #14221
Minor: use the minimum fetch #14221
Conversation
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.
Thanks @xudong963. Can you also add a small unit test?
Thanks, I'll do it later |
It's difficult for me to construct such ut, I didn't construct a test that will go to the condition datafusion/datafusion/core/src/physical_optimizer/sort_pushdown.rs Lines 106 to 112 in 5edb276
Do you have any ideas? @berkaysynnada |
@@ -107,6 +107,12 @@ fn pushdown_sorts_helper( | |||
// Make sure this `SortExec` satisfies parent requirements: | |||
let sort_reqs = requirements.data.ordering_requirement.unwrap_or_default(); | |||
// It's possible current plan (`SortExec`) has a fetch value. | |||
// And if both of them have fetch values, we should use the minimum one. |
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.
It's difficult for me to construct such ut, I didn't construct a test that will go to the condition
I don't think it is possible today to hit this code (as the requirements
will contain the sort correctly)
Thus I think it would be fine to merge this as is in my opinion, or perhaps you could add a check that the requirement_fetch is <= the sort_fetch if present
It doesn't seem possible without explicitly setting it (and that would not have much meaning). Let's merge this once you've resolved the conflicts. |
09d6a90
to
425d36b
Compare
Thanks @alamb @berkaysynnada |
Which issue does this PR close?
Closes #14192 (comment)
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?