alamb commented on code in PR #8559:
URL: https://github.com/apache/arrow-datafusion/pull/8559#discussion_r1429133521


##########
datafusion/sqllogictest/test_files/window.slt:
##########
@@ -3794,8 +3794,36 @@ select a,
 1 1
 2 1
 
+# support scalar value in ORDER BY 
 query I
 select rank() over (order by 1) rnk from (select 1 a union all select 2 a) x
 ----
 1
 1
+
+# support scalar value in both ORDER BY and PARTITION BY, RANK function

Review Comment:
   👍  as @mustafasrepo  points out



##########
datafusion/sql/src/expr/function.rs:
##########
@@ -90,6 +90,8 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
             let partition_by = window
                 .partition_by
                 .into_iter()
+                //ignore window spec PARTITION BY for scalar values

Review Comment:
   ```suggestion
                   // ignore window spec PARTITION BY for scalar values
                   // as they do not change and thus do not generate new 
partitions
   ```
   
   I also double checked 
https://docs.rs/sqlparser/latest/sqlparser/ast/enum.Value.html is indeed the 
right node for literals



-- 
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