apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
6.04k stars 1.14k forks source link

Unify schema usage in Datafusion #10442

Open comphead opened 4 months ago

comphead commented 4 months ago

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

https://github.com/apache/datafusion/blob/fad16e74229decc40bccf22947d3659cd29fee6f/datafusion/expr/src/logical_plan/plan.rs#L913-L925

_Originally posted by @alamb in https://github.com/apache/datafusion/pull/10405#discussion_r1594332291_

yyy1000 commented 4 months ago

When I try to fix this, I found that there may be a latent issue. I want to open #10494 to discuss it.