Ted-Jiang commented on code in PR #4485: URL: https://github.com/apache/arrow-datafusion/pull/4485#discussion_r1038926524
########## datafusion/proto/src/lib.rs: ########## @@ -1331,4 +1333,67 @@ mod roundtrip_tests { roundtrip_expr_test(test_expr, ctx.clone()); roundtrip_expr_test(test_expr_with_count, ctx); } + #[test] + fn roundtrip_window() { + let ctx = SessionContext::new(); + + // 1. without window_frame + let test_expr1 = Expr::WindowFunction { + fun: WindowFunction::BuiltInWindowFunction( + datafusion_expr::window_function::BuiltInWindowFunction::Rank, + ), + args: vec![], + partition_by: vec![col("col1")], + order_by: vec![col("col2")], + window_frame: None, + }; + + // 2. with default window_frame + let test_expr2 = Expr::WindowFunction { + fun: WindowFunction::BuiltInWindowFunction( + datafusion_expr::window_function::BuiltInWindowFunction::Rank, + ), + args: vec![], + partition_by: vec![col("col1")], + order_by: vec![col("col2")], + window_frame: Some(WindowFrame::default()), + }; + + // 3. with window_frame with row numbers + let range_number_frame = WindowFrame { + units: WindowFrameUnits::Range, + start_bound: WindowFrameBound::Preceding(ScalarValue::UInt64(Some(2))), + end_bound: WindowFrameBound::Following(ScalarValue::UInt64(Some(2))), Review Comment: without this commit, this test will fail. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org