ClickHouse/tests/queries/0_stateless/01346_array_join_mrxotey.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
444 B
MySQL
Raw Normal View History

2020-06-25 23:52:26 +00:00
DROP TABLE IF EXISTS test;
CREATE TABLE test (
a Date,
b UInt32,
c UInt64,
p Nested (
at1 String,
at2 String
)
) ENGINE = MergeTree()
PARTITION BY a
ORDER BY b
SETTINGS index_granularity = 8192;
INSERT INTO test (a, b, c, p.at1, p.at2)
VALUES (now(), 1, 2, ['foo', 'bar'], ['baz', 'qux']);
SELECT b
FROM test
ARRAY JOIN p
WHERE
b = 1
AND c IN (
SELECT c FROM test
);
DROP TABLE test;