You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type coercion doesn't seem to handle NULL in a CASE branch when used inside of an aggregate.
To Reproduce
In Datafusion CLI:
> CREATE TABLE example(data double precision);
0 row(s) fetched.
Elapsed 0.005 seconds.
> SELECT sum(CASE WHEN data is NULL THEN NULL ELSE data + 1 END) FROM example;
Error during planning: Execution error: User-defined coercion failed with Execution("Sum not supported for Null") No function matches the given name and argument types 'sum(Null)'. You might need to add explicit type casts.
Candidate functions:
sum(UserDefined)