gene-bordegaray commented on code in PR #18661:
URL: https://github.com/apache/datafusion/pull/18661#discussion_r2525576331
##########
datafusion/physical-optimizer/src/enforce_sorting/mod.rs:
##########
@@ -516,10 +516,7 @@ pub fn ensure_sorting(
);
child = update_sort_ctx_children_data(child, true)?;
}
- } else if physical_ordering.is_none()
- || !plan.maintains_input_order()[idx]
- || is_union(plan)
- {
+ } else if physical_ordering.is_none() ||
!plan.maintains_input_order()[idx] {
Review Comment:
Yes I was very confused as well when stepping through the logic. The only
thing I could think of is if it was thought that UnionExec was never able to
maintain input order but it is implemented for the operator.
Interesting though since this is quoted from the documentation online about
the operator: "UnionExec combines multiple inputs with the same schema by
concatenating the partitions. It does not mix or copy data within or across
partitions. Thus if the input partitions are sorted, the output partitions of
the union are also sorted."
--
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]