Conversation
berkaysynnada
left a comment
There was a problem hiding this comment.
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 |
| // 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
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?