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

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

    [ https://issues.apache.org/jira/browse/SPARK-41805?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17653444#comment-17653444 ] 

Apache Spark commented on SPARK-41805:
--------------------------------------

User 'wankunde' has created a pull request for this issue:
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
>            Priority: Major
>
> 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