jayzhan211 commented on issue #10785:
URL: https://github.com/apache/datafusion/issues/10785#issuecomment-2148799000

   `StateFieldsArgs ` can be constructed without AggregateFuncitonExpr.
   
   This is how we calculate state fields.
   ```
   fn state_fields(&self) -> Result<Vec<Field>> {
           let args = StateFieldsArgs {
               name: &self.name,
               input_type: &self.input_type,
               return_type: &self.data_type,
               ordering_fields: &self.ordering_fields,
               is_distinct: self.is_distinct,
           };
   
           self.fun.state_fields(args)
       }
   ```
   
   You can see `create_aggregate_expr` to know how these arguments are built.
   If the functions does not event need `ordering_fields`,  you can even set 
ordering_fields to `&[]`


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to