Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-43979][SQL][FOLLOWUP] transformUpWithNewOutput` should only be…
… used with new outputs ### What changes were proposed in this pull request? This is a followup of apache#41475 . It's risky to use `transformUpWithNewOutput` with existing attribute ids. If the plan contains duplicated attribute ids somewhere, then we will hit conflicting attributes and an assertion error will be thrown by `QueryPlan#transformUpWithNewOutput`. This PR takes a different approach. We canonicalize the plan first and then remove the alias-only project. Then we don't need `transformUpWithNewOutput` anymore as all attribute ids are normalized in the canonicalized plan. ### Why are the changes needed? fix potential bugs ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? existing tests Closes apache#42408 from cloud-fan/collect-metrics. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Kent Yao <yao@apache.org> (cherry picked from commit 4f25df1) Signed-off-by: Kent Yao <yao@apache.org>
- Loading branch information