yyy1000 commented on code in PR #10370:
URL: https://github.com/apache/datafusion/pull/10370#discussion_r1589461277


##########
datafusion/sql/src/unparser/expr.rs:
##########
@@ -1004,7 +1076,7 @@ mod tests {
                     ),
                     null_treatment: None,
                 }),
-                r#"COUNT(*) OVER (RANGE BETWEEN 6 PRECEDING AND 2 FOLLOWING)"#,
+                r#"COUNT(* ORDER BY "a" DESC NULLS FIRST) OVER (RANGE BETWEEN 
6 PRECEDING AND 2 FOLLOWING)"#,

Review Comment:
   This is a bit out of my expectation. I don't know whether the two 
expressions are the same.🤔
   From 
   
https://github.com/apache/datafusion/blob/8190cb97216e4f46faccbeddae57f6773587955f/datafusion/core/tests/dataframe/mod.rs#L171-L194,
 
   it should be `COUNT(*) OVER(ORDER BY a DESC RANGE BETWEEN 6 PRECEDING AND 2 
FOLLOWING)`,
   I doubt it should be an issue from the fmt for Function in sql-parser, if 
there is an over and order_by, it should put the order by in Over 
https://github.com/sqlparser-rs/sqlparser-rs/blob/71a7262e38e1c10a46fd50ea7c5610091e1aca3c/src/ast/mod.rs#L4869-L4904



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


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

Reply via email to