如何alter/change Clickhouse 中的物化视图TTL?
How to alter/change Materialized View TTL in the Clickhouse?
我有物化视图:
CREATE MATERIALIZED VIEW reporting_device_raw_data
ENGINE = MergeTree()
PARTITION BY toYYYYMM(ts)
ORDER BY (device_id, ts)
TTL ts + INTERVAL 3 MONTH
AS SELECT
device_id,
ts,
value
FROM reporting_device_raw_data_null;
我试过:
ALTER TABLE reporting_device_raw_data MODIFY TTL ts + INTERVAL 12 MONTH;
但是出现错误:
DB::Exception: Alter of type 'MODIFY TTL' is not supported by storage MaterializedView.
有哪些可能的解决方法?
检查 show create database ....
数据库引擎。
普通数据库:
ALTER TABLE ".inner.reporting_device_raw_data" MODIFY TTL ts + INTERVAL 12 MONTH;
原子数据库:
select uuid from system.tables where name = 'reporting_device_raw_data';
ALTER TABLE ".inner_id.{uuid from prev. select}" MODIFY TTL ts + INTERVAL 12 MONTH;
我有物化视图:
CREATE MATERIALIZED VIEW reporting_device_raw_data
ENGINE = MergeTree()
PARTITION BY toYYYYMM(ts)
ORDER BY (device_id, ts)
TTL ts + INTERVAL 3 MONTH
AS SELECT
device_id,
ts,
value
FROM reporting_device_raw_data_null;
我试过:
ALTER TABLE reporting_device_raw_data MODIFY TTL ts + INTERVAL 12 MONTH;
但是出现错误:
DB::Exception: Alter of type 'MODIFY TTL' is not supported by storage MaterializedView.
有哪些可能的解决方法?
检查 show create database ....
数据库引擎。
普通数据库:
ALTER TABLE ".inner.reporting_device_raw_data" MODIFY TTL ts + INTERVAL 12 MONTH;
原子数据库:
select uuid from system.tables where name = 'reporting_device_raw_data';
ALTER TABLE ".inner_id.{uuid from prev. select}" MODIFY TTL ts + INTERVAL 12 MONTH;