Uh oh!
There was an error while loading. Please reload this page.
Minor: use the minimum fetch - #14221
Conversation
berkaysynnada
left a comment
There was a problem hiding this comment.
Thanks @xudong963. Can you also add a small unit test?
xudong963
commented
Jan 22, 2025
Thanks, I'll do it later |
xudong963
commented
Jan 22, 2025
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 |
| // 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.
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
berkaysynnada
commented
Jan 22, 2025
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. |
xudong963
commented
Jan 23, 2025
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?