-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed as not planned
Labels
Description
We have a simple druid sql query to return the count of some events.
select count(*) from events where type='the event'The problem is that if no events match the query no rows are returned, since we use it for alerts we'd like the query above to return a row with 0 value in case no events match the where clause. How can we achieve this?
The closest I managed was with
select sum(c) from (
select count(*) as c from events where type='the event'
union all
select 0 as c from events limit 1
)which fails with Cannot build plan for query, but succeeds if the sum(c) is replaced with just c.
Reactions are currently unavailable