kosiew commented on code in PR #21801:
URL: https://github.com/apache/datafusion/pull/21801#discussion_r3245642125
##########
datafusion/sql/tests/cases/plan_to_sql.rs:
##########
@@ -2848,6 +2849,253 @@ fn test_unparse_window() -> Result<()> {
Ok(())
}
+#[test]
+fn test_unparse_window_over_aggregate_without_projection() -> Result<()> {
+ let schema = Schema::new(vec![
+ Field::new("time", DataType::Int64, false),
+ Field::new("value", DataType::Float64, true),
+ ]);
+ let window_expr = Expr::WindowFunction(Box::new(WindowFunction {
+ fun: WindowFunctionDefinition::WindowUDF(row_number_udwf()),
+ params: WindowFunctionParams {
+ args: vec![],
+ partition_by: vec![],
+ order_by: vec![col("time").sort(true, true)],
+ window_frame: WindowFrame::new(None),
+ null_treatment: None,
+ distinct: false,
+ filter: None,
+ },
+ }))
+ .alias("row_idx");
+ let plan = table_scan(Some("gas"), &schema, None)?
+ .aggregate(vec![col("time")], vec![sum(col("value")).alias("sum_n")])?
+ .window(vec![window_expr])?
Review Comment:
@PiotrSrebrny
Does
https://github.com/apache/datafusion/pull/21801/commits/5e8b64ac32c7f7810dd01d69434b310035f54616
fix your issue?
--
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]