[
https://issues.apache.org/jira/browse/SPARK-39120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yuming Wang updated SPARK-39120:
--------------------------------
Description:
{code:scala}
sql("create table t1(a int, b int, c int) using parquet")
sql("select a, max(b) from (select a, b, a, b, a from t1) group by
a").explain(true)
{code}
Current:
{noformat}
== Optimized Logical Plan ==
Aggregate [a#0], [a#0, max(b#1) AS max(b)#4]
+- Project [a#0, b#1, a#0, b#1, a#0]
+- Relation default.t1[a#0,b#1,c#2] parquet
{noformat}
Expected:
{noformat}
== Optimized Logical Plan ==
Aggregate [a#0], [a#0, max(b#1) AS max(b)#4]
+- Project [a#0, b#1]
+- Relation default.t1[a#0,b#1,c#2] parquet
{noformat}
> Prunes the duplicate columns from child of UnaryNode
> ----------------------------------------------------
>
> Key: SPARK-39120
> URL: https://issues.apache.org/jira/browse/SPARK-39120
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 3.4.0
> Reporter: Yuming Wang
> Priority: Major
>
> {code:scala}
> sql("create table t1(a int, b int, c int) using parquet")
> sql("select a, max(b) from (select a, b, a, b, a from t1) group by
> a").explain(true)
> {code}
> Current:
> {noformat}
> == Optimized Logical Plan ==
> Aggregate [a#0], [a#0, max(b#1) AS max(b)#4]
> +- Project [a#0, b#1, a#0, b#1, a#0]
> +- Relation default.t1[a#0,b#1,c#2] parquet
> {noformat}
> Expected:
> {noformat}
> == Optimized Logical Plan ==
> Aggregate [a#0], [a#0, max(b#1) AS max(b)#4]
> +- Project [a#0, b#1]
> +- Relation default.t1[a#0,b#1,c#2] parquet
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]