hi, team, any insight on this SQL issue I am tryin...
# troubleshooting
i
hi, team, any insight on this SQL issue I am trying to use
distinctCount
aggregation function to count under different conditions
Copy code
select distinctCount(case when condition1 then colA else null end) as condition1Count,
    distinctCount(case when condition2 then colA else null end) as condition2Count,
    distinctCount(case when condition3 then colA else null end) as condition3Count
from tableA
colA is type int or String. but looks like it’s not supported in pinot cause null is not supported in the selection query Will there be a future support for this.
x
It requires same type for functions to be applied. You can cast them to string always
i
do you mean change the
null
to
'null'
? I tried that by then
'null'
is counted as one distinct value
x
yes, right now the work around is to handle null as one distinct value. The real null support in aggregation function will be supported later
i
ok, thanks