mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-05 05:52:05 +00:00
8 lines
431 B
SQL
8 lines
431 B
SQL
set extremes = '1';
|
|
DROP TABLE IF EXISTS HASH_TEST_INSERT;
|
|
DROP TABLE IF EXISTS HASH_MV;
|
|
CREATE TABLE HASH_TEST_INSERT (`STR_VAL` String) ENGINE = Null;
|
|
CREATE MATERIALIZED VIEW HASH_MV (`HASH_VAL` UInt64, `STR_VAL` LowCardinality(String)) ENGINE = ReplacingMergeTree ORDER BY HASH_VAL AS SELECT xxHash64(STR_VAL) AS HASH_VAL, toLowCardinality(STR_VAL) AS STR_VAL FROM HASH_TEST_INSERT;
|
|
INSERT INTO HASH_TEST_INSERT VALUES ('a');
|
|
|