mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
add test
This commit is contained in:
parent
b601b66146
commit
eb6a7684df
2
tests/queries/0_stateless/02933_ephemeral_mv.reference
Normal file
2
tests/queries/0_stateless/02933_ephemeral_mv.reference
Normal file
@ -0,0 +1,2 @@
|
||||
3 3
|
||||
42 42
|
30
tests/queries/0_stateless/02933_ephemeral_mv.sql
Normal file
30
tests/queries/0_stateless/02933_ephemeral_mv.sql
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
CREATE TABLE raw
|
||||
(
|
||||
name String,
|
||||
num String
|
||||
) ENGINE = MergeTree
|
||||
ORDER BY (name);
|
||||
|
||||
CREATE TABLE parsed_eph
|
||||
(
|
||||
name String,
|
||||
num_ephemeral UInt32 EPHEMERAL,
|
||||
num UInt32 MATERIALIZED num_ephemeral,
|
||||
) ENGINE = MergeTree
|
||||
ORDER BY (name);
|
||||
|
||||
CREATE MATERIALIZED VIEW parse_mv_eph
|
||||
TO parsed_eph
|
||||
AS
|
||||
SELECT
|
||||
name,
|
||||
toUInt32(num) as num_ephemeral
|
||||
FROM raw;
|
||||
|
||||
INSERT INTO raw VALUES ('3', '3'), ('42', '42');
|
||||
SELECT name, num FROM parsed_eph;
|
||||
|
||||
DROP VIEW parse_mv_eph;
|
||||
DROP TABLE parsed_eph;
|
||||
DROP TABLE raw;
|
Loading…
Reference in New Issue
Block a user