SELECT toStartOfDay(addHours(shjy.event."#event_time", 8)) AS date,
       shjy.event."#event_name"                            AS event_name,
       `app_name`,
       arrayDistinct(groupArray(shjy.event."#account_id")) AS values,
       length(values) as num

FROM shjy.event
WHERE addHours(shjy.event."#event_time", 8) >= '2021-05-10 00:00:00'
  AND addHours(shjy.event."#event_time", 8) < '2021-06-08 23:59:59'
  AND shjy.event."#event_name" IN ('create_role', 'login')
GROUP BY toStartOfDay(addHours(shjy.event."#event_time", 8)), shjy.event."#event_name", `app_name`
ORDER BY date
LIMIT 1000