xudong963 commented on code in PR #14192:
URL: https://github.com/apache/datafusion/pull/14192#discussion_r1922030000


##########
datafusion/core/src/physical_optimizer/sort_pushdown.rs:
##########
@@ -103,7 +106,8 @@ fn pushdown_sorts_helper(
         if !satisfy_parent {
             // Make sure this `SortExec` satisfies parent requirements:
             let sort_reqs = 
requirements.data.ordering_requirement.unwrap_or_default();
-            let fetch = requirements.data.fetch;
+            // It's possible current plan (`SortExec`) has a fetch value.
+            let fetch = requirements.data.fetch.or(sort_fetch);

Review Comment:
   i don't find a case that both requirement fetch and sort fetch are Some and 
requirement fetch is large than sort fetch 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to