Merge pull request #11974 from ClickHouse/tests-for-8692

Added tests for #8692
This commit is contained in:
alexey-milovidov 2020-06-26 20:52:33 +03:00 committed by GitHub
commit 6d6ea4249c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,2 @@
NEW 2
\N 2

View File

@ -0,0 +1,28 @@
DROP TABLE IF EXISTS test;
CREATE TABLE test
(
`id` Nullable(String),
`status` Nullable(Enum8('NEW' = 0, 'CANCEL' = 1)),
`nested.nestedType` Array(Nullable(String)),
`partition` Date
) ENGINE = MergeTree() PARTITION BY partition
ORDER BY
partition SETTINGS index_granularity = 8192;
INSERT INTO test VALUES ('1', 'NEW', array('a', 'b'), now());
SELECT
status,
count() AS all
FROM test ARRAY JOIN nested as nestedJoined
WHERE (status IN (
SELECT status
FROM test ARRAY JOIN nested as nestedJoined
GROUP BY status
ORDER BY count() DESC
LIMIT 10)) AND (id IN ('1', '2'))
GROUP BY CUBE(status)
LIMIT 100;
DROP TABLE test;

View File

@ -0,0 +1,2 @@
1
1

View File

@ -0,0 +1,28 @@
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;