AngersZhuuuu edited a comment on issue #27861: [SPARK-30707][SQL]Window 
function set partitionSpec as order spec when orderSpec is empty
URL: https://github.com/apache/spark/pull/27861#issuecomment-597467691
 
 
   ```
   angerszhu=# select id, sum(num) over (partition by id range between 1 
preceding and 1 following)
   angerszhu-# from s4 ;
   ERROR:  RANGE with offset PRECEDING/FOLLOWING requires exactly one ORDER BY 
column
   LINE 1: select id, sum(num) over (partition by id
                                    ^
   angerszhu=# 
   angerszhu=# 
   angerszhu=# select id, sum(num) over (partition by id   rows between 1 
preceding and 1 following)           from s4 ;
    id | sum 
   ----+-----
     1 |   3
     2 |   3
     3 |   6
     4 |   7
     5 |   9
     6 |   9
   (6 rows)
   
   angerszhu=# select id, sum(num) over (partition by id   range between 1 
preceding and 1 following)             from s4 ;
   ERROR:  RANGE with offset PRECEDING/FOLLOWING requires exactly one ORDER BY 
column
   LINE 1: select id, sum(num) over (partition by id
                                    ^
   angerszhu=# select id, sum(num) over (partition by id   range 1 preceding)   
from s4 ;
   ERROR:  RANGE with offset PRECEDING/FOLLOWING requires exactly one ORDER BY 
column
   LINE 1: select id, sum(num) over (partition by id
                                    ^
   angerszhu=# select id, sum(num) over (partition by id  rows 1 preceding)  
from s4 ;
    id | sum 
   ----+-----
     1 |   3
     2 |   3
     3 |   6
     4 |   7
     5 |   9
     6 |   9
   (6 rows)
   
   angerszhu=# 
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to