jychen7 commented on code in PR #3530:
URL: https://github.com/apache/arrow-datafusion/pull/3530#discussion_r1164721798


##########
datafusion/core/src/physical_plan/sorts/sort.rs:
##########
@@ -816,14 +831,14 @@ fn sort_batch(
     batch: RecordBatch,
     schema: SchemaRef,
     expr: &[PhysicalSortExpr],
+    fetch: Option<usize>,
 ) -> ArrowResult<BatchWithSortArray> {
-    // TODO: pushup the limit expression to sort
     let sort_columns = expr
         .iter()
         .map(|e| e.evaluate_to_sort_column(&batch))
         .collect::<Result<Vec<SortColumn>>>()?;
 
-    let indices = lexsort_to_indices(&sort_columns, None)?;
+    let indices = lexsort_to_indices(&sort_columns, fetch)?;

Review Comment:
   > I think you're right that providing fetch to the other lexsort_to_indices 
would be beneficial as well. I will create a issue for this and issue a PR 
later.
   
   for other readers, this is addressed by 
https://github.com/apache/arrow-datafusion/issues/3544 and fixed by 
https://github.com/apache/arrow-datafusion/pull/3545



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

Reply via email to