jcsherin commented on code in PR #13421:
URL: https://github.com/apache/datafusion/pull/13421#discussion_r1842812820
##########
datafusion/proto/tests/cases/roundtrip_physical_plan.rs:
##########
@@ -263,12 +273,74 @@ fn roundtrip_nested_loop_join() -> Result<()> {
Ok(())
}
+#[test]
+fn roundtrip_udwf() -> Result<()> {
+ let field_a = Field::new("a", DataType::Int64, false);
+ let field_b = Field::new("b", DataType::Int64, false);
+ let schema = Arc::new(Schema::new(vec![field_a, field_b]));
+
+ let udwf_expr = Arc::new(BuiltInWindowExpr::new(
+ create_udwf_window_expr(
+ &row_number_udwf(),
+ &[],
+ &schema,
+ "row_number() PARTITION BY [a] ORDER BY [b] RANGE BETWEEN
UNBOUNDED PRECEDING AND CURRENT ROW".to_string(),
+ false,
+ )?,
+ &[
+ col("a", &schema)?
+ ],
+ &LexOrdering::new(vec![
+ PhysicalSortExpr::new(col("b", &schema)?, SortOptions::new(true,
true)),
+ ]),
+ Arc::new(WindowFrame::new(None)),
+ ));
+
+ let input = Arc::new(EmptyExec::new(schema.clone()));
+
+ roundtrip_test(Arc::new(BoundedWindowAggExec::try_new(
+ vec![udwf_expr],
+ input,
+ vec![col("a", &schema)?],
+ InputOrderMode::Sorted,
+ )?))
+}
+
#[test]
fn roundtrip_window() -> Result<()> {
let field_a = Field::new("a", DataType::Int64, false);
let field_b = Field::new("b", DataType::Int64, false);
let schema = Arc::new(Schema::new(vec![field_a, field_b]));
+ let window_frame = WindowFrame::new_bounds(
+ datafusion_expr::WindowFrameUnits::Range,
+ WindowFrameBound::Preceding(ScalarValue::Int64(None)),
+ WindowFrameBound::CurrentRow,
+ );
+
+ let nth_value_window =
Review Comment:
This is the test referred in
https://github.com/apache/datafusion/pull/13201#discussion_r1836543691
--
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]