Sometimes DF uses 2 schema sources, which is schema from previous node and current like in example(s) below.
Would be nice to check if we can use only 1 schema, multiple schemas are usually confusing
I agree it doesn't make sense -- however, it is the same logic as in `with_new_exprs`:
|
LogicalPlan::Union(Union { schema, .. }) => { |
|
let input_schema = inputs[0].schema(); |
|
// If inputs are not pruned do not change schema. |
|
let schema = if schema.fields().len() == input_schema.fields().len() { |
|
schema.clone() |
|
} else { |
|
input_schema.clone() |
|
}; |
|
Ok(LogicalPlan::Union(Union { |
|
inputs: inputs.into_iter().map(Arc::new).collect(), |
|
schema, |
|
})) |
|
} |
Originally posted by @alamb in #10405 (comment)
Sometimes DF uses 2 schema sources, which is schema from previous node and current like in example(s) below.
Would be nice to check if we can use only 1 schema, multiple schemas are usually confusing
datafusion/datafusion/expr/src/logical_plan/plan.rs
Lines 913 to 925 in fad16e7
Originally posted by @alamb in #10405 (comment)