AngersZhuuuu commented 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-610139401 In redshift, we can use window function without order by, and don't have other limit. Presto: ``` presto:default> select * from test_part; id | dt -----------------------------------------+---- aaa | 1 aaa | 1 aaa | 1 (3 rows) Query 20200407_022813_00091_ebcxm, FINISHED, 4 nodes Splits: 19 total, 19 done (100.00%) 0:01 [3 rows, 150B] [3 rows/s, 169B/s] presto:default> select id, sum(dt) over (partition by id range between 1 preceding and 1 following) -> from test_part; Query 20200407_022920_00103_ebcxm failed: line 1:42: Window frame RANGE PRECEDING is only supported with UNBOUNDED select id, sum(dt) over (partition by id range between 1 preceding and 1 following) from test_part presto:default> select id, sum(dt) over (partition by id rows between 1 preceding and 1 following) from test_part ; id | _col1 -----------------------------------------+------- aaa | 2.0 aaa | 3.0 aaa | 2.0 (3 rows) Query 20200407_023016_00106_ebcxm, FINISHED, 60 nodes Splits: 1,939 total, 1,939 done (100.00%) 0:01 [3 rows, 150B] [4 rows/s, 242B/s] presto:default> select id, sum(dt) over (partition by id range between 1 preceding and 1 following) from test_part ; Query 20200407_023107_00115_ebcxm failed: line 1:44: Window frame RANGE PRECEDING is only supported with UNBOUNDED select id, sum(dt) over (partition by id range between 1 preceding and 1 following) from test_part presto:default> select id, sum(dt) over (partition by id range 1 preceding) from test_part ; Query 20200407_023136_00116_ebcxm failed: line 1:44: Window frame RANGE PRECEDING is only supported with UNBOUNDED select id, sum(dt) over (partition by id range 1 preceding) from test_part presto:default> select id, sum(dt) over (partition by id) from test_part; id | _col1 -----------------------------------------+------- aaaa | 3.0 aaaa | 3.0 aaaa | 3.0 (3 rows) Query 20200407_023142_00117_ebcxm, FINISHED, 60 nodes Splits: 1,939 total, 1,939 done (100.00%) 0:01 [3 rows, 150B] [5 rows/s, 266B/s] presto:default> ```
---------------------------------------------------------------- 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]
