alamb commented on a change in pull request #607:
URL: https://github.com/apache/arrow-datafusion/pull/607#discussion_r657109398
##########
File path: datafusion/src/sql/planner.rs
##########
@@ -2826,6 +2818,16 @@ mod tests {
quick_test(sql, expected);
}
+ #[test]
+ fn empty_over_dup_with_alias() {
+ let sql = "SELECT order_id oid, MAX(order_id) OVER () max_oid,
MAX(order_id) OVER () max_oid_dup from orders";
+ let expected = "\
+ Projection: #orders.order_id AS oid, #MAX(orders.order_id) AS max_oid,
#MAX(orders.order_id) AS max_oid_dup\
+ \n WindowAggr: windowExpr=[[MAX(#orders.order_id)]]\
Review comment:
this is pretty cool that the planner has identified the redundancy and
only computes `MAX` once 👍
--
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]