jayzhan211 commented on code in PR #9874:
URL: https://github.com/apache/arrow-datafusion/pull/9874#discussion_r1545646896


##########
datafusion/expr/src/expr_fn.rs:
##########
@@ -796,15 +809,101 @@ impl AggregateUDFImpl for SimpleAggregateUDF {
         Ok(self.return_type.clone())
     }
 
-    fn accumulator(&self, arg: &DataType) -> Result<Box<dyn 
crate::Accumulator>> {
-        (self.accumulator)(arg)
+    fn accumulator(
+        &self,
+        arg: &DataType,
+        sort_exprs: &[Expr],
+        schema: &Schema,
+        _ignore_nulls: bool,
+        _requirement_satisfied: bool,
+    ) -> Result<Box<dyn crate::Accumulator>> {
+        (self.accumulator)(arg, sort_exprs, schema)
     }
 
     fn state_type(&self, _return_type: &DataType) -> Result<Vec<DataType>> {
         Ok(self.state_type.clone())
     }
 }
 
+pub struct FirstValue {
+    name: String,
+    signature: Signature,
+    accumulator: AccumulatorFactoryFunctionForFirstValue,

Review Comment:
   The reason is that we don't have the arguments while register the functions, 
so only the pre-defined function is provided
   
   ```rust
         let first_value = create_first_value(
             "FIRST_VALUE",
             Signature::uniform(1, NUMERICS.to_vec(), Volatility::Immutable),
             Arc::new(create_first_value_accumulator),
         );
   
        // arguments for accumulator are unknown yet
         let _ = new_self.register_udaf(Arc::new(first_value));
   ```



-- 
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]

Reply via email to