mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 07:01:59 +00:00
Merge pull request #11974 from ClickHouse/tests-for-8692
Added tests for #8692
This commit is contained in:
commit
6d6ea4249c
@ -0,0 +1,2 @@
|
||||
NEW 2
|
||||
\N 2
|
@ -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;
|
@ -0,0 +1,2 @@
|
||||
1
|
||||
1
|
28
tests/queries/0_stateless/01346_array_join_mrxotey.sql
Normal file
28
tests/queries/0_stateless/01346_array_join_mrxotey.sql
Normal 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;
|
Loading…
Reference in New Issue
Block a user