zhuqi-lucas commented on code in PR #24963:
URL: https://github.com/apache/datafusion/pull/24963#discussion_r3944077879


##########
datafusion/physical-plan/src/union.rs:
##########
@@ -694,8 +711,14 @@ impl InterleaveExec {
         schema: SchemaRef,
     ) -> Result<PlanProperties> {
         let eq_properties = EquivalenceProperties::new(schema);
-        // Get output partitioning:
-        let output_partitioning = inputs[0].output_partitioning().clone();
+        // Get output partitioning. Only claim the shared hash / range layout
+        // when every input actually has it (see `try_new_unchecked`).
+        let first_partitioning = inputs[0].output_partitioning();
+        let output_partitioning = if can_interleave(inputs.iter()) {
+            first_partitioning.clone()
+        } else {
+            
Partitioning::UnknownPartitioning(first_partitioning.partition_count())

Review Comment:
   One non-blocking nit: in the degraded branch, 
`UnknownPartitioning(first_partitioning.partition_count())` takes the count 
from `inputs[0]`. If another child has more partitions, those are never 
executed —
   silent row loss rather than an error. Unreachable through the planner since 
the Executable check rejects the plan first, but `max()` over the children 
would make the bypass path fail loudly instead. One line, and it costs nothing?



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