Table with TTL to S3
ClickHouse has an ability to store part of any table in S3. An example ClickHouse database query, to create a table with automatic move of data that passed some specified time period.
Attach S3 as a storage engine to ClickHouse
CREATE TABLE table_name
(
`someField` String,
`value` String,
`offset` UInt64,
`partition` UInt16,
`timestamp` DateTime64(3)
)
ENGINE = MergeTree
PARTITION BY toDate(timestamp)
ORDER BY (offset, timestamp, someField)
TTL toStartOfDay(timestamp, 'UTC') + toIntervalDay(14) TO VOLUME 's3'
SETTINGS storage_policy = 'tiered', index_granularity = 8192PreviousAttach S3 as a storage engine to ClickHouseNextPartition ClickHouse table based on unique string hash
Last updated