ClickHouse/tests/queries/0_stateless/03174_projection_deduplicate.sql
Yakov Olkhovskiy 3fc4d8988b better test
2024-07-04 21:51:57 +00:00

31 lines
777 B
SQL

-- https://github.com/ClickHouse/ClickHouse/issues/65548
DROP TABLE IF EXISTS test_projection_deduplicate;
CREATE TABLE test_projection_deduplicate
(
`id` Int32,
`string` String,
PROJECTION test_projection
(
SELECT id
GROUP BY id
)
)
ENGINE = MergeTree
PRIMARY KEY id;
INSERT INTO test_projection_deduplicate VALUES (1, 'one');
INSERT INTO test_projection_deduplicate VALUES (1, 'one');
OPTIMIZE TABLE test_projection_deduplicate DEDUPLICATE; -- { serverError NOT_IMPLEMENTED }
SELECT * FROM test_projection_deduplicate;
ALTER TABLE test_projection_deduplicate DROP PROJECTION test_projection;
OPTIMIZE TABLE test_projection_deduplicate DEDUPLICATE;
SELECT * FROM test_projection_deduplicate;
DROP TABLE test_projection_deduplicate;