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
I found a bug of druid sql about having. when I add having condition of "count(distinct uid)". It will return []. if I replace it for "having count(uid)", it will return right result.for example:
{
"query": "select (count(distinct("uid")) filter (where binlog_event='i')) as __y,Floor(__time to MINUTE) as __time from "test_dataSource" where __time > TIMESTAMP '2017-10-12 00:00:00' and __time < TIMESTAMP '2017-10-12 23:59:59' group by Floor(__time to MINUTE) having (count("uid") filter (where binlog_event='i')) >0",
"context": {
"sqlTimeZone": "Asia/Shanghai",
"skipEmptyBuckets": "false"
}
}
the reasult is:
[
{
"__y": 1,
"__time": "2017-10-12T01:54:00.000+08:00"
},
{
"__y": 2,
"__time": "2017-10-12T02:23:00.000+08:00"
}
]
but when I used having (count(distinct("uid")) filter (where binlog_event='i')) >0
the result is:
[]
Activity
gianm commentedon Oct 13, 2017
Thanks for the report. This looks related to #4883 and can be fixed after that patch is committed.
gianm commentedon Oct 16, 2017
There are some utilities in #4890 that would help with fixing this bug too, so I'll try to get that one committed first.
Fix havingSpec on complex aggregators. (#5024)
Fix havingSpec on complex aggregators. (apache#5024)