Jefffrey commented on code in PR #18091:
URL: https://github.com/apache/datafusion/pull/18091#discussion_r2437952623
##########
datafusion/functions-aggregate/src/average.rs:
##########
@@ -125,8 +126,61 @@ impl AggregateUDFImpl for Avg {
&self.signature
}
+ fn coerce_types(&self, arg_types: &[DataType]) -> Result<Vec<DataType>> {
+ let [args] = take_function_args(self.name(), arg_types)?;
+
+ // Supported types smallint, int, bigint, real, double precision,
decimal, or interval
+ // Refer to
https://www.postgresql.org/docs/8.2/functions-aggregate.html doc
+ fn coerced_type(data_type: &DataType) -> Result<DataType> {
Review Comment:
Looks like we need this inner function since it recurses on itself for
dictionary; maybe in future we can look into seeing if we can express this via
TypeSignature API instead of doing this user defined way
--
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]