haohuaijin commented on code in PR #8402:
URL: https://github.com/apache/arrow-datafusion/pull/8402#discussion_r1413023842


##########
datafusion/sqllogictest/test_files/window.slt:
##########
@@ -3727,3 +3727,24 @@ FROM score_board s
 
 statement ok
 DROP TABLE score_board;
+
+# test window spec PARTITION BY/ORDER BY for scalar values should be ignored, 
only scalars in window spec
+# single row
+query III
+select a, 
+       rank() over (partition by 10, 'a', null order by 20, 10, 'a', null) rnk,
+       row_number() over (partition by 10, 'a', null order by 20, 10, 'a', 
null) rn
+       from (select 1 a) q

Review Comment:
   maybe you can use `order by a` to make the result stable.
   ```sql
   select a, 
          rank() over (partition by 10, a, 'a', null order by 20, a, 10, 'a', 
null) rnk,
          row_number() over (partition by 10, a, 'a', null order by 20, a, 10, 
'a', null) rn
          from (select 2 a union all select 1 a) q order by a;
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to