jayzhan211 commented on code in PR #9874:
URL: https://github.com/apache/arrow-datafusion/pull/9874#discussion_r1545522347
##########
datafusion/expr/src/function.rs:
##########
@@ -38,9 +39,20 @@ pub type ReturnTypeFunction =
Arc<dyn Fn(&[DataType]) -> Result<Arc<DataType>> + Send + Sync>;
/// Factory that returns an accumulator for the given aggregate, given
-/// its return datatype.
-pub type AccumulatorFactoryFunction =
- Arc<dyn Fn(&DataType) -> Result<Box<dyn Accumulator>> + Send + Sync>;
+/// its return datatype, the sorting expressions and the schema for ordering.
+pub type AccumulatorFactoryFunction = Arc<
+ dyn Fn(&DataType, &[Expr], &Schema) -> Result<Box<dyn Accumulator>> + Send
+ Sync,
+>;
+
+/// Factory that returns an accumulator for the given aggregate, given
+/// its return datatype, the sorting expressions and the schema for ordering.
+/// FirstValue needs additional `ignore_nulls` and `requirement_satisfied`
flags.
+// TODO: It would be nice if we can have flexible design for arbitrary
arguments.
Review Comment:
Before we have a flexible design, I plan to have one default function that
has the common arguments and specifically define others that have additional
arguments. Like what it is now.
--
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]