Github user gatorsmile commented on the pull request:

    https://github.com/apache/spark/pull/10678#issuecomment-170707667
  
    I can reproduce the problem using a simple query now:
    ```
    select area, rank() over (partition by area order by month) as c1
    from windowData group by product, area, month order by product
    ```
    
    The logical plan is like 
    ```
    'Sort ['p ASC], true
    +- Project [area#1,c1#11]
       +- Project [area#1,month#0,tmp1#10,_we0#17,(_we0#17 + tmp1#10) AS c1#11]
          +- Window [area#1,month#0,tmp1#10], [rank(month#0) 
windowspecdefinition(area#1,month#0 ASC,ROWS BETWEEN UNBOUNDED PRECEDING AND 
CURRENT ROW) AS _we0#17], [area#1], [month#0 ASC]
             +- Project [area#1,month#0,tmp1#10]
                +- Subquery tmp
                   +- Project [month#0,area#1,product#2 AS p#9,1 AS tmp1#10]
                      +- Subquery windowdata
                         +- LogicalRDD [month#0,area#1,product#2], 
MapPartitionsRDD[1] at apply at Transformer.scala:22
    ```
    
    This does not match the existing two patterns. Thus, it is unable to 
resolve the sorting columns. I will try to find and write a general rule to 
handle the cases, as you suggested. 


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to