2010YOUY01 opened a new issue, #11749:
URL: https://github.com/apache/datafusion/issues/11749
### Describe the bug
Literal scalar NULLs are generally not supported in aggregate functions.
I tried postgres and DuckDB, they all works, it's good to add small patches
for NULL literals.
The fix could be:
1. Find out all available aggregate functions that is not working for null
literal
2. Try to match the behavior of postgres
Reproducer in datafusion-cli
```
> select min(null);
Internal error: Min/Max accumulator not implemented for type Null.
This was likely caused by a bug in DataFusion's code and we would welcome
that you file an bug report in our issue tracker
> select avg(null);
Error during planning: Execution error: User-defined coercion failed with
Plan("The function \"avg\" does not support inputs of type Null.") No function
matches the given name and argument types 'avg(Null)'. You might need to add
explicit type casts.
Candidate functions:
avg(UserDefined)
```
### To Reproduce
_No response_
### Expected behavior
_No response_
### Additional context
Found by SQLancer https://github.com/apache/datafusion/issues/11030
--
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]