Jefffrey commented on code in PR #17085:
URL: https://github.com/apache/datafusion/pull/17085#discussion_r2390273336
##########
datafusion/expr/src/udaf.rs:
##########
@@ -762,7 +762,24 @@ pub trait AggregateUDFImpl: Debug + DynEq + DynHash + Send
+ Sync {
/// group during query execution.
///
/// acc_args: [`AccumulatorArgs`] contains information about how the
- /// aggregate function was called.
+ /// aggregate function was called. Use `acc_args.exprs` together with
+ /// `acc_args.schema` to inspect the [`FieldRef`] of each input.
+ ///
+ /// Example: retrieving metadata and return field for input `i`:
+ /// ```ignore
+ /// let metadata = acc_args.schema.field(i).metadata();
+ /// let field = acc_args.exprs[i].return_field(&acc_args.schema)?;
+ /// ```
Review Comment:
I'm having some trouble understanding this example; I can understand the
part for getting the metadata of a field given the context of the PR, but why
do we also include an example for getting the return field?
##########
datafusion/physical-expr/src/aggregate.rs:
##########
@@ -24,6 +24,92 @@ pub(crate) mod groups_accumulator {
accumulate::NullState, GroupsAccumulatorAdapter,
};
}
+
+#[cfg(test)]
+mod tests {
Review Comment:
Tests should be at the bottom of the file
##########
datafusion/physical-expr/src/aggregate.rs:
##########
@@ -24,6 +24,92 @@ pub(crate) mod groups_accumulator {
accumulate::NullState, GroupsAccumulatorAdapter,
};
}
+
+#[cfg(test)]
Review Comment:
Tests should be moved to the bottom of the file
--
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]