ClickHouse/tests/queries/0_stateless/03037_union_view.sql

32 lines
664 B
MySQL
Raw Normal View History

-- https://github.com/ClickHouse/ClickHouse/issues/55803
2024-07-12 12:49:26 +00:00
SET enable_analyzer=1;
2024-04-02 16:01:55 +00:00
DROP TABLE IF EXISTS broken_table;
DROP TABLE IF EXISTS broken_view;
CREATE TABLE broken_table
(
start DateTime64(6),
end DateTime64(6),
)
ENGINE = ReplacingMergeTree(start)
ORDER BY (start);
CREATE VIEW broken_view as
SELECT
t.start as start,
t.end as end,
cast(datediff('second', t.start, t.end) as float) as total_sec
FROM broken_table t FINAL
UNION ALL
SELECT
null as start,
null as end,
null as total_sec;
SELECT v.start, v.total_sec
FROM broken_view v FINAL
WHERE v.start IS NOT NULL;
2024-04-02 16:01:55 +00:00
DROP TABLE IF EXISTS broken_table;
2024-07-12 12:49:26 +00:00
DROP TABLE IF EXISTS broken_view;