You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zml1206 (via GitHub)" <gi...@apache.org> on 2023/02/27 02:48:05 UTC

[GitHub] [spark] zml1206 opened a new pull request, #40182: [SPARK-42588][SQL] Collapse two adjacent windows with the equivalent partition/order expressions

zml1206 opened a new pull request, #40182:
URL: https://github.com/apache/spark/pull/40182

   ### What changes were proposed in this pull request?
   Extend the CollapseWindow rule to collapse Window nodes with the equivalent partition/order expressions
   
   
   ### Why are the changes needed?
   ```
   Seq((1, 1), (2, 2)).toDF("a", "b")
         .withColumn("max_b", expr("max(b) OVER (PARTITION BY abs(a))"))
         .withColumn("min_b", expr("min(b) OVER (PARTITION BY abs(a))"))
   
   == Optimized Logical Plan ==
   before
   Project [a#7, b#8, max_b#11, min_b#17]
   +- Window [min(b#8) windowspecdefinition(_w0#19, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS min_b#17], [_w0#19]
      +- Project [a#7, b#8, max_b#11, abs(a#7) AS _w0#19]
         +- Window [max(b#8) windowspecdefinition(_w0#13, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS max_b#11], [_w0#13]
            +- Project [_1#2 AS a#7, _2#3 AS b#8, abs(_1#2) AS _w0#13]
               +- LocalRelation [_1#2, _2#3]
   after
   Project [a#7, b#8, max_b#11, min_b#17]
   +- Window [max(b#8) windowspecdefinition(_w0#13, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS max_b#11, min(b#8) windowspecdefinition(_w0#13, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS min_b#17], [_w0#13]
      +- Project [_1#2 AS a#7, _2#3 AS b#8, abs(_1#2) AS _w0#13]
         +- LocalRelation [_1#2, _2#3]
   ```
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   UT
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] github-actions[bot] commented on pull request #40182: [SPARK-42588][SQL] Collapse two adjacent windows with the equivalent partition/order expressions in two withColumn()

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #40182:
URL: https://github.com/apache/spark/pull/40182#issuecomment-1626384790

   We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] github-actions[bot] closed pull request #40182: [SPARK-42588][SQL] Collapse two adjacent windows with the equivalent partition/order expressions in two withColumn()

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #40182: [SPARK-42588][SQL] Collapse two adjacent windows with the equivalent partition/order expressions in two withColumn()
URL: https://github.com/apache/spark/pull/40182


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] zml1206 commented on pull request #40182: [SPARK-42588][SQL] Collapse two adjacent windows with the equivalent partition/order expressions in two withColumn()

Posted by "zml1206 (via GitHub)" <gi...@apache.org>.
zml1206 commented on PR #40182:
URL: https://github.com/apache/spark/pull/40182#issuecomment-1487904058

   cc @cloud-fan , thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] zml1206 commented on pull request #40182: [SPARK-42588][SQL] Collapse two adjacent windows with the equivalent partition/order expressions

Posted by "zml1206 (via GitHub)" <gi...@apache.org>.
zml1206 commented on PR #40182:
URL: https://github.com/apache/spark/pull/40182#issuecomment-1445894470

   @wangyum 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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