Skip to content

Commit

Permalink
Fix compilation, change row_number() expr_fn to 0 args (#12043)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Aug 17, 2024
1 parent e84f343 commit cb1e3f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion datafusion/core/src/dataframe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions datafusion/functions-window/src/row_number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
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.
Expand Down
2 changes: 1 addition & 1 deletion datafusion/proto/tests/cases/roundtrip_logical_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb1e3f0

Please sign in to comment.