Github user yhuai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7515#discussion_r35946255
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
    @@ -818,7 +818,8 @@ class Analyzer(
               failAnalysis(s"$expr has multiple Window Specifications 
($distinctWindowSpec)." +
                 s"Please file a bug report with this error message, stack 
trace, and the query.")
             } else {
    -          distinctWindowSpec.head
    +          val unbounded = SpecifiedWindowFrame(RowFrame, 
UnboundedPreceding, UnboundedFollowing)
    --- End diff --
    
    Let's add a comment at here to explain what we are doing. Seems, we create 
a dummy window frame, so we only use `PARTITION BY` clause and `ORDER BY` 
clause to do grouping.
    
    Actually, can we just extract partitioning expressions and ordering 
expressions and explicitly use them as the grouping key? That will make the 
code easier to understand. Also, we probably want to remove the argument 
`windowSpec` from both logical and physical Window operator because we create 
`WindowFunctionFrame` based on the frame definition of every WindowExpression's 
frame definition.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to