You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2023/01/09 05:35:00 UTC

[jira] [Resolved] (SPARK-41805) Reuse expressions in WindowSpecDefinition

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

Wenchen Fan resolved SPARK-41805.
---------------------------------
    Fix Version/s: 3.4.0
       Resolution: Fixed

Issue resolved by pull request 39333
[https://github.com/apache/spark/pull/39333]

> Reuse expressions in WindowSpecDefinition
> -----------------------------------------
>
>                 Key: SPARK-41805
>                 URL: https://issues.apache.org/jira/browse/SPARK-41805
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.4.0
>            Reporter: Wan Kun
>            Assignee: Wan Kun
>            Priority: Major
>             Fix For: 3.4.0
>
>
> For complex expressions in window spec definition, we extract it and replace it with an AttributeReference (with an internal column name, e.g. "_w0").
> We can reuse the extracted expressions to avoid generator unnecessary Window node.
> For example: the logical plan of query
> {code:sql}
> SELECT max(value) over(partition by (key) order by cast(ts as timestamp)) as w1,
>        min(value) over(partition by (key) order by cast(ts as timestamp)) as w2
> FROM t1
> {code}
> contains two Window node.



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

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