Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

Commit 101c1e2

Browse files
committed
fix: use clickhouse-compatible ttl expression for datetime64
1 parent 57cdbab commit 101c1e2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/publish/clickhouse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ CREATE TABLE IF NOT EXISTS %s.%s (
9595
ENGINE = MergeTree()
9696
PARTITION BY toYYYYMM(time)
9797
ORDER BY (provider, entity_type, time, id)
98-
TTL time + INTERVAL 1 YEAR
98+
TTL toDateTime(time) + INTERVAL 1 YEAR
9999
SETTINGS index_granularity = 8192`, s.cfg.Database, s.cfg.Table)
100100

101101
if err := s.conn.Exec(ctx, query); err != nil {

0 commit comments

Comments
 (0)