It's rather easy and well documented how to compact the data in clickhouse after TTL, for example from the docs...
CREATE TABLE events
(
`event` String,
`time` DateTime,
`value` UInt64
)
ENGINE = MergeTree
ORDER BY (toDate(time), event)
TTL time + INTERVAL 1 MONTH GROUP BY toDate(time), event SET value = SUM(value)
What I currently fail to grasp is how to compact it down to two rows, instead of one. For example let's say I have only dates and values and want the min
and max
for the day here instead of the sum
. So, for example...
time | value |
---|---|
2024-12-24 01:00:00 | 1 |
2024-12-24 02:00:00 | 2 |
2024-12-24 03:00:00 | 3 |
2024-12-24 04:00:00 | 4 |
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744357978a4570327.html
评论列表(0条)