Skip to content

Commit

Permalink
fix conflicts (#14221)
Browse files Browse the repository at this point in the history
  • Loading branch information
xudong963 authored Jan 23, 2025
1 parent 440fcb2 commit 0228bee
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,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.
if let Some(fetch) = sort_fetch {
if let Some(requirement_fetch) = requirements.data.fetch {
requirements.data.fetch = Some(fetch.min(requirement_fetch));
}
}
let fetch = requirements.data.fetch.or(sort_fetch);
requirements = requirements.children.swap_remove(0);
requirements = add_sort_above(requirements, sort_reqs, fetch);
Expand Down

0 comments on commit 0228bee

Please sign in to comment.