jcsherin commented on code in PR #12279:
URL: https://github.com/apache/datafusion/pull/12279#discussion_r1740619596
##########
datafusion/functions-aggregate/src/nth_value.rs:
##########
@@ -30,19 +30,33 @@ use datafusion_common::{exec_err, internal_err,
not_impl_err, Result, ScalarValu
use datafusion_expr::function::{AccumulatorArgs, StateFieldsArgs};
use datafusion_expr::utils::format_state_name;
use datafusion_expr::{
- Accumulator, AggregateUDFImpl, ReversedUDAF, Signature, Volatility,
+ lit, Accumulator, AggregateUDFImpl, ExprFunctionExt, ReversedUDAF,
Signature,
+ SortExpr, Volatility,
};
use datafusion_functions_aggregate_common::merge_arrays::merge_ordered_arrays;
use datafusion_functions_aggregate_common::utils::ordering_fields;
use datafusion_physical_expr::expressions::Literal;
use datafusion_physical_expr_common::sort_expr::{LexOrdering,
PhysicalSortExpr};
-make_udaf_expr_and_func!(
- NthValueAgg,
- nth_value,
- "Returns the nth value in a group of values.",
- nth_value_udaf
-);
+create_func!(NthValueAgg, nth_value_udaf);
+
+/// Returns the nth value in a group of values.
+pub fn nth_value(
+ expr: datafusion_expr::Expr,
+ n: i64,
+ order_by: Option<Vec<SortExpr>>,
Review Comment:
You are right. The option type is extraneous here. I'll make this change.
--
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]