From cb1e3f0e5cfd04195ae0c933b74f3eb3fcbe1b45 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Sat, 17 Aug 2024 07:41:19 -0400 Subject: [PATCH] Fix compilation, change row_number() expr_fn to 0 args (#12043) --- datafusion/core/src/dataframe/mod.rs | 2 +- datafusion/functions-window/src/row_number.rs | 4 ++-- datafusion/proto/tests/cases/roundtrip_logical_plan.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/datafusion/core/src/dataframe/mod.rs b/datafusion/core/src/dataframe/mod.rs index 760ebd7392e5..8920a89af11e 100644 --- a/datafusion/core/src/dataframe/mod.rs +++ b/datafusion/core/src/dataframe/mod.rs @@ -1710,13 +1710,13 @@ mod tests { use datafusion_common::{Constraint, Constraints, ScalarValue}; use datafusion_common_runtime::SpawnedTask; use datafusion_expr::expr::WindowFunction; - use datafusion_expr::window_function::row_number; use datafusion_expr::{ cast, create_udf, expr, lit, BuiltInWindowFunction, ExprFunctionExt, ScalarFunctionImplementation, Volatility, WindowFrame, WindowFrameBound, WindowFrameUnits, WindowFunctionDefinition, }; use datafusion_functions_aggregate::expr_fn::{array_agg, count_distinct}; + use datafusion_functions_window::expr_fn::row_number; use datafusion_physical_expr::expressions::Column; use datafusion_physical_plan::{get_plan_string, ExecutionPlanProperties}; use sqlparser::ast::NullTreatment; diff --git a/datafusion/functions-window/src/row_number.rs b/datafusion/functions-window/src/row_number.rs index 08d711182434..aea3d4a59e02 100644 --- a/datafusion/functions-window/src/row_number.rs +++ b/datafusion/functions-window/src/row_number.rs @@ -31,8 +31,8 @@ use datafusion_expr::{Expr, PartitionEvaluator, Signature, Volatility, WindowUDF /// Create a [`WindowFunction`](Expr::WindowFunction) expression for /// `row_number` user-defined window function. -pub fn row_number(args: Vec) -> Expr { - Expr::WindowFunction(WindowFunction::new(row_number_udwf(), args)) +pub fn row_number() -> Expr { + Expr::WindowFunction(WindowFunction::new(row_number_udwf(), vec![])) } /// Singleton instance of `row_number`, ensures the UDWF is only created once. diff --git a/datafusion/proto/tests/cases/roundtrip_logical_plan.rs b/datafusion/proto/tests/cases/roundtrip_logical_plan.rs index 4b20f14ddeb4..09c5f0f8bd3d 100644 --- a/datafusion/proto/tests/cases/roundtrip_logical_plan.rs +++ b/datafusion/proto/tests/cases/roundtrip_logical_plan.rs @@ -904,7 +904,7 @@ async fn roundtrip_expr_api() -> Result<()> { vec![lit(1), lit(2), lit(3)], vec![lit(10), lit(20), lit(30)], ), - row_number(vec![col("a")]), + row_number(), ]; // ensure expressions created with the expr api can be round tripped