ozankabak commented on code in PR #7924:
URL: https://github.com/apache/arrow-datafusion/pull/7924#discussion_r1372210103
##########
datafusion/core/src/physical_optimizer/enforce_sorting.rs:
##########
@@ -496,9 +496,10 @@ fn ensure_sorting(
{
// This SortPreservingMergeExec is unnecessary, input already has a
// single partition.
+ sort_onwards.truncate(1);
return Ok(Transformed::Yes(PlanWithCorrespondingSort {
- plan: children[0].clone(),
- sort_onwards: vec![sort_onwards[0].clone()],
+ plan: children.swap_remove(0),
Review Comment:
Yes exactly, your observation is correct -- in this case
`children.pop().unwrap()` and `swap_remove(0)` is equivalent.
--
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]