You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEraw
(
name String,
ts String
) ENGINE = MergeTree
ORDER BY (name, ts);
CREATETABLEparsed
(
name String,
ts_ephemeral Nullable(DateTime64(9)), -- no EPHEMERAL
ts DateTime64(9, 'UTC') MATERIALIZED if(ts_ephemeral IS NULL, date(0), ts_ephemeral),
) ENGINE = MergeTree
ORDER BY (name, ts);
CREATETABLEparsed_eph
(
name String,
ts_ephemeral Nullable(DateTime64(9)) EPHEMERAL, -- with EPHEMERAL
ts DateTime64(9, 'UTC') MATERIALIZED if(ts_ephemeral IS NULL, date(0), ts_ephemeral),
) ENGINE = MergeTree
ORDER BY (name, ts);
CREATE MATERIALIZED VIEW parse_mv_eph
TO parsed_eph
ASSELECT
name,
toDateTime64OrNull(ts, 9 ,'UTC') as ts_ephemeral
FROM raw;
CREATE MATERIALIZED VIEW parse_mv
TO parsed
ASSELECT
name,
toDateTime64OrNull(ts, 9 ,'UTC') as ts_ephemeral
FROM raw;
INSERT INTO raw VALUES ('abc', '1451611580')
SELECT'input_parsed';
SELECT
name,
toDateTime64OrNull(ts, 9 ,'UTC') as ts_ephemeral
FROM raw;
SELECT'parsed';
SELECT name, ts FROM parsed;
SELECT'parsed_eph';
SELECT name, ts FROM parsed_eph;
https://fiddle.clickhouse.com/0f10a874-8f3f-464a-a21a-5bf39d8d786a
The text was updated successfully, but these errors were encountered: