Dandandan commented on code in PR #3545:
URL: https://github.com/apache/arrow-datafusion/pull/3545#discussion_r975526035
##########
datafusion/core/src/physical_plan/sorts/sort.rs:
##########
@@ -374,44 +379,38 @@ fn get_sorted_iter(
})
})
.collect::<Result<Vec<_>>>()?;
- let indices = lexsort_to_indices(&sort_columns, None)?;
+ let indices = lexsort_to_indices(&sort_columns, fetch)?;
- Ok(SortedIterator::new(indices, row_indices, batch_size))
+ //Only maintain composite indexes
+ let row_indices = indices
+ .values()
+ .into_iter()
+ .map(|i| row_indices[*i as usize])
+ .collect();
+
+ Ok(SortedIterator::new(row_indices, batch_size))
Review Comment:
Some cleanup - we can do this immediately instead of keeping it in
`SortedIterator`
--
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]