Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
Description
Queries below should return NULL:
0: jdbc:drill:schema=dfs> select sum(a2) from t2 where 1=0; +------------+ | EXPR$0 | +------------+ +------------+ No rows selected (0.08 seconds) 0: jdbc:drill:schema=dfs> select avg(a2) from t2 where 1=0; +------------+ | EXPR$0 | +------------+ +------------+ No rows selected (0.074 seconds)
When grouped, result is correct:
0: jdbc:drill:schema=dfs> select a2, sum(a2) from t2 where 1=0 group by a2; +------------+------------+ | a2 | EXPR$1 | +------------+------------+ +------------+------------+ No rows selected (0.11 seconds)
I'm not convinced and it is not very intuitive that correct result should be NULL, but this is what postgres returns and Aman thinks NULL is the correct behavior
Attachments
Issue Links
- is duplicated by
-
DRILL-2277 COUNT(*) should return 0 instead of an empty result set when there are no records
- Closed