alamb commented on code in PR #11812:
URL: https://github.com/apache/datafusion/pull/11812#discussion_r1709784405
##########
datafusion/sqllogictest/test_files/aggregate.slt:
##########
@@ -5520,3 +5520,9 @@ set datafusion.explain.logical_plan_only = false;
statement ok
drop table employee_csv;
+
+# test null literal handling in supported aggregate functions
+query I??III?T
+select count(null), min(null), max(null), bit_and(NULL), bit_or(NULL),
bit_xor(NULL), nth_value(NULL, 1), string_agg(NULL, ',');
Review Comment:
I double checked with postgres. This looks good except for `count` where
`count(null)` is zero (not `null`)
```
postgres=# select count(null), min(null), max(null), string_agg(NULL, ',');
count | min | max | string_agg
-------+-----+-----+------------
0 | | |
(1 row)
postgres=# select count(null) IS NULL, min(null) IS NULL, max(null) IS NULL,
string_agg(NULL, ',') IS NULL;
?column? | ?column? | ?column? | ?column?
----------+----------+----------+----------
f | t | t | t
(1 row)
```
However, this seems better than what we have today on main (which is an
internal error):
```sql
DataFusion CLI v40.0.0
> select count(null), min(null), max(null), string_agg(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 count(null) IS NULL, min(null) IS NULL, max(null) IS NULL,
string_agg(NULL, ',') IS 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
```
--
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]