datafusion_physical_plan::union

Function can_interleave

Source
pub fn can_interleave<T: Borrow<Arc<dyn ExecutionPlan>>>(
    inputs: impl Iterator<Item = T>,
) -> bool
Expand description

If all the input partitions have the same Hash partition spec with the first_input_partition The InterleaveExec is partition aware.

It might be too strict here in the case that the input partition specs are compatible but not exactly the same. For example one input partition has the partition spec Hash(‘a’,‘b’,‘c’) and other has the partition spec Hash(‘a’), It is safe to derive the out partition with the spec Hash(‘a’,‘b’,‘c’).