Clickhouse分桶聚合后填充零值问题
作者:互联网
select count(a) as acount, toStartOfInterval(timestamp, INTERVAL 1440 minute) as c_time
from `fill_test`
where b = 'hello'
and timestamp >= '2022-01-01 00:00:00'
and timestamp <= '2022-04-31 23:59:59'
group by c_time
order by c_time asc WITH FILL FROM toDateTime('2022-01-01 00:00:00') TO toDateTime('2022-04-31 23:59:59') STEP 1 * 60 * 60 * 24;
- 使用WITH FILL对order by的字段进行填充
- FROM...TO 标识要填充的范围
- STEP表示要填充的粒度,秒
标签:...,00,01,分桶,填充,timestamp,STEP,零值,Clickhouse 来源: https://www.cnblogs.com/darope/p/16084755.html