mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 02:41:59 +00:00
8eb528cbe6
Before this patch any additional syntax, like: - projections - data skipping indexes Had not been passed to the inner table (in case MV had been created without explicit TO table). Yes, this is not a "recommended" way of using, but still, it should work. v2: fix tests failures for Ordinary engine Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
59 lines
1.2 KiB
SQL
59 lines
1.2 KiB
SQL
-- Tags: no-random-merge-tree-settings
|
|
|
|
DROP TABLE IF EXISTS data;
|
|
DROP TABLE IF EXISTS mv_indexes;
|
|
DROP TABLE IF EXISTS mv_no_indexes;
|
|
DROP TABLE IF EXISTS mv_projections;
|
|
DROP TABLE IF EXISTS mv_primary_key;
|
|
DROP TABLE IF EXISTS mv_primary_key_from_column;
|
|
|
|
CREATE TABLE data
|
|
(
|
|
key String,
|
|
)
|
|
ENGINE = MergeTree
|
|
ORDER BY key;
|
|
|
|
CREATE MATERIALIZED VIEW mv_indexes
|
|
(
|
|
key String,
|
|
INDEX idx key TYPE bloom_filter GRANULARITY 1
|
|
)
|
|
ENGINE = MergeTree
|
|
ORDER BY key
|
|
AS SELECT * FROM data;
|
|
|
|
CREATE MATERIALIZED VIEW mv_no_indexes
|
|
(
|
|
key String,
|
|
INDEX idx key TYPE bloom_filter GRANULARITY 1
|
|
)
|
|
ENGINE = Null
|
|
AS SELECT * FROM data;
|
|
|
|
CREATE MATERIALIZED VIEW mv_projections
|
|
(
|
|
key String,
|
|
projection p (SELECT uniqCombined(key))
|
|
)
|
|
ENGINE = MergeTree
|
|
ORDER BY key
|
|
AS SELECT * FROM data;
|
|
|
|
CREATE MATERIALIZED VIEW mv_primary_key
|
|
(
|
|
key String,
|
|
PRIMARY KEY key
|
|
)
|
|
ENGINE = MergeTree
|
|
AS SELECT * FROM data;
|
|
|
|
CREATE MATERIALIZED VIEW mv_primary_key_from_column
|
|
(
|
|
key String PRIMARY KEY
|
|
)
|
|
ENGINE = MergeTree
|
|
AS SELECT * FROM data;
|
|
|
|
SELECT replaceRegexpOne(create_table_query, 'CREATE TABLE [^ ]*', 'CREATE TABLE x') FROM system.tables WHERE database = currentDatabase() and table LIKE '.inner%' ORDER BY 1 FORMAT LineAsString;
|