Added a test for #2219

This commit is contained in:
Alexey Milovidov 2020-04-20 11:15:43 +03:00
parent 9d0004cba0
commit 848e4a0541
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,32 @@
DROP TABLE IF EXISTS test_table;
DROP TABLE IF EXISTS test_table_sharded;
create table
test_table_sharded(
date Date,
text String,
hash UInt64
)
engine=MergeTree(date, (hash, date), 8192);
create table test_table as test_table_sharded
engine=Distributed(test_cluster_two_shards, currentDatabase(), test_table_sharded, hash);
SET distributed_product_mode = 'local';
SET insert_distributed_sync = 1;
INSERT INTO test_table VALUES ('2020-04-20', 'Hello', 123);
SELECT
text,
uniqExactIf(hash, hash IN (
SELECT DISTINCT
hash
FROM test_table AS t1
)) as counter
FROM test_table AS t2
GROUP BY text
ORDER BY counter, text;
DROP TABLE test_table;
DROP TABLE test_table_sharded;