[ 
https://issues.apache.org/jira/browse/SPARK-52385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wenchen Fan reassigned SPARK-52385:
-----------------------------------

    Assignee: Mihailo Aleksic

> Remove TempResolvedColumns from InheritAnalysisRules name
> ---------------------------------------------------------
>
>                 Key: SPARK-52385
>                 URL: https://issues.apache.org/jira/browse/SPARK-52385
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 4.1.0
>            Reporter: Mihailo Aleksic
>            Assignee: Mihailo Aleksic
>            Priority: Major
>              Labels: pull-request-available
>
> In this issue I propose to remove the TempResolvedColumn nodes when computing 
> the name for InheritAnalysisRules nodes (they are not removed during the 
> ResolveAggregateFunctions rule). This is the right behavior as 
> TempResolvedColumn is an internal node and shouldn't be exposed to the users.
> The following query:
> SELECT sum(col1) FROM VALUES(1) GROUP BY ALL HAVING sum(ifnull(col1, 1)) = 1
> Would have following analyzed plans:
> Before the change:
> Project [sum(col1)#2L]
> +- Filter (sum(ifnull(tempresolvedcolumn(col1), 1))#4L = cast(1 as bigint))
>    +- Aggregate [sum(col1#0) AS sum(col1)#2L, 
> sum(ifnull(tempresolvedcolumn(col1#0, col1, false), 1)) AS 
>                             sum(ifnull(tempresolvedcolumn(col1), 1))#4L]
>       +- LocalRelation [col1#0]
> After the change:
> Project [sum(col1)#2L]
> +- Filter (sum(ifnull(col1, 1))#4L = cast(1 as bigint))
>    +- Aggregate [sum(col1#0) AS sum(col1)#2L, 
> sum(ifnull(tempresolvedcolumn(col1#0, col1, false), 1)) AS sum(ifnull(col1, 
> 1))#4L]
>       +- LocalRelation [col1#0]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to