Skip to content

Commit 8cb0343

Browse files
author
Jiayu Liu
committed
fix unit test
1 parent 36e01ff commit 8cb0343

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

datafusion/src/sql/planner.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2703,14 +2703,20 @@ mod tests {
27032703
#[test]
27042704
fn empty_over() {
27052705
let sql = "SELECT order_id, MAX(order_id) OVER () from orders";
2706-
let expected = "Projection: #order_id, AGGREGATEFUNCTION(MAX)(#order_id)\n WindowAggr: windowExpr=[[AGGREGATEFUNCTION(MAX)(#order_id)]] partitionBy=[], orderBy=[]\n TableScan: orders projection=None";
2706+
let expected = "\
2707+
Projection: #order_id, #MAX(order_id)\
2708+
\n WindowAggr: windowExpr=[[MAX(#order_id)]] partitionBy=[], orderBy=[]\
2709+
\n TableScan: orders projection=None";
27072710
quick_test(sql, expected);
27082711
}
27092712

27102713
#[test]
2711-
fn empty_over_with_alias() {
2712-
let sql = "SELECT order_id, MAX(order_id) OVER () max_order_id from orders";
2713-
let expected = "Projection: #order_id, AGGREGATEFUNCTION(MAX)(#order_id) AS max_order_id\n WindowAggr: windowExpr=[[AGGREGATEFUNCTION(MAX)(#order_id)]] partitionBy=[], orderBy=[]\n TableScan: orders projection=None";
2714+
fn empty_over_plus() {
2715+
let sql = "SELECT order_id, MAX(qty * 1.1) OVER () from orders";
2716+
let expected = "\
2717+
Projection: #order_id, #MAX(qty Multiply Float64(1.1))\
2718+
\n WindowAggr: windowExpr=[[MAX(#qty Multiply Float64(1.1))]] partitionBy=[], orderBy=[]\
2719+
\n TableScan: orders projection=None";
27142720
quick_test(sql, expected);
27152721
}
27162722

0 commit comments

Comments
 (0)