findepi commented on code in PR #11256:
URL: https://github.com/apache/datafusion/pull/11256#discussion_r1667103815
##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -322,10 +322,16 @@ impl ExprSchemable for Expr {
}
}
Expr::Cast(Cast { expr, .. }) => expr.nullable(input_schema),
- Expr::AggregateFunction(AggregateFunction { func_def, .. }) => {
+ Expr::AggregateFunction(AggregateFunction { func_def, args, .. })
=> {
match func_def {
+ // TODO: min/max over non-nullable input should be
recognized as non-nullable
AggregateFunctionDefinition::BuiltIn(fun) =>
fun.nullable(),
// TODO: UDF should be able to customize nullability
+ AggregateFunctionDefinition::UDF(udf)
+ if udf.name() == "count" && args.len() <= 1 =>
Review Comment:
i didn't know this exists. The code defines `count` as variadic. The
semantics of 2+-arg count don't seem to be documented and are not easy to grasp
around effect of nulls.
For now, i will just drop the arg size condition.
--
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]