ClickHouse/tests/queries/0_stateless/01710_projection_mutation.sql

10 lines
466 B
MySQL
Raw Normal View History

DROP TABLE IF EXISTS t;
CREATE TABLE t (`key` UInt32, `created_at` Date, `value` UInt32, PROJECTION xxx (SELECT key, created_at, sum(value) GROUP BY key, created_at)) ENGINE = MergeTree PARTITION BY toYYYYMM(created_at) ORDER BY key;
INSERT INTO t SELECT 1 AS key, today() + (number % 30), number FROM numbers(1000);
2023-05-10 01:35:13 +00:00
ALTER TABLE t UPDATE value = 0 WHERE (value > 0) AND (created_at >= '2021-12-21') SETTINGS optimize_use_projections = 1;
2022-02-04 11:31:58 +00:00
DROP TABLE IF EXISTS t;