sgrebnov commented on code in PR #21744:
URL: https://github.com/apache/datafusion/pull/21744#discussion_r3129017418


##########
datafusion/physical-optimizer/src/pushdown_sort.rs:
##########
@@ -105,7 +106,9 @@ impl PhysicalOptimizerRule for PushdownSort {
                 match sort_input.try_pushdown_sort(required_ordering)? {
                     SortOrderPushdownResult::Exact { inner } => {
                         let inner = if let Some(fetch) = sort_child.fetch() {
-                            inner.with_fetch(Some(fetch)).unwrap_or(inner)
+                            inner.with_fetch(Some(fetch)).unwrap_or_else(|| {
+                                Arc::new(GlobalLimitExec::new(inner, 0, 
Some(fetch)))

Review Comment:
   @martin-g - great point, thank you. Updated to use `LocalLimitExec`



-- 
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