We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e211960 commit 001865dCopy full SHA for 001865d
datafusion/physical-plan/src/union.rs
@@ -468,7 +468,13 @@ pub fn can_interleave<T: Borrow<Arc<dyn ExecutionPlan>>>(
468
}
469
470
fn union_schema(inputs: &[Arc<dyn ExecutionPlan>]) -> SchemaRef {
471
- let fields: Vec<Field> = (0..inputs[0].schema().fields().len())
+ let fields: Vec<Field> = (0..std::cmp::max(
472
+ inputs[0].schema().fields().len(),
473
+ inputs
474
+ .get(1)
475
+ .map(|l| l.schema().fields().len())
476
+ .unwrap_or_default(),
477
+ ))
478
.map(|i| {
479
inputs
480
.iter()
0 commit comments