mustafasrepo commented on code in PR #10651: URL: https://github.com/apache/datafusion/pull/10651#discussion_r1621861446
########## datafusion/expr/src/expr_schema.rs: ########## @@ -158,7 +160,29 @@ impl ExprSchemable for Expr { .iter() .map(|e| e.get_type(schema)) .collect::<Result<Vec<_>>>()?; - fun.return_type(&data_types) + match fun { + WindowFunctionDefinition::AggregateUDF(udf) => { + let new_types = data_types_with_aggregate_udf(&data_types, udf).map_err(|err| { + plan_datafusion_err!( + "{} and {}", + err, + utils::generate_signature_error_msg( + fun.name(), + fun.signature().clone(), + &data_types + ) + ) + })?; + Ok(fun.return_type(&new_types)?) + } Review Comment: Maybe we should bury this check, and conversion inside to the `fun.return_type` implementation for `WindowFunctionDefinition::AggregateUDF` not sure though. -- 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