datafusion
datafusion copied to clipboard
Avoid copies in `TypeCoercion` via TreeNode API
Draft as it has a failure in tpchds planning for some reason
Which issue does this PR close?
Closes https://github.com/apache/datafusion/issues/10210
Part of https://github.com/apache/arrow-datafusion/issues/9637 -- let's make DataFusion planning faster by not copying so much
Rationale for this change
Now that we have the nice TreeNode API thanks to #8913 and @peter-toth let's use it to both simplify the code and avoid copies
What changes are included in this PR?
- Avoid copies in
TypeCoercionvia TreeNode API
Are these changes tested?
Existing CI
Are there any user-facing changes?
An update here is twofold:
- There are some very subtle semantics going on
- As this pass actually changes the types of the plan (on purpose) we need some way to recalculate the schemas (which is what
Plan::with_new_exprsdoes, but it also requires a copy of the inputs and exprs, which is not cool
I am still putzing with how to make this better
superceded by https://github.com/apache/datafusion/pull/10356