You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-40149][SQL][FOLLOWUP] Avoid adding extra Project in AddMetadataColumns
This PR is a follow-up for apache#37758. It updates the rule `AddMetadataColumns` to avoid introducing extra `Project`.
To fix an issue introduced by apache#37758.
```sql
-- t1: [key, value] t2: [key, value]
select t1.key, t2.key from t1 full outer join t2 using (key)
```
Before this PR, the rule `AddMetadataColumns` will add a new Project between the using join and the select list:
```
Project [key, key]
+- Project [key, key, key, key] <--- extra project
+- Project [coalesce(key, key) AS key, value, value, key, key]
+- Join FullOuter, (key = key)
:- LocalRelation <empty>, [key#0, value#0]
+- LocalRelation <empty>, [key#0, value#0]
```
After this PR, this extra Project will be removed.
No
Add a new UT.
Closesapache#39895 from allisonwang-db/spark-40149-follow-up.
Authored-by: allisonwang-db <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit 286d336)
Signed-off-by: Wenchen Fan <[email protected]>
0 commit comments