ClickHouse/tests/queries/0_stateless/03093_analyzer_miel_test.sql
2024-04-09 21:10:05 +02:00

17 lines
664 B
SQL

-- https://github.com/ClickHouse/ClickHouse/issues/58985
DROP TABLE IF EXISTS test_03093;
CREATE TABLE test_03093 (app String, c UInt64, k Map(String, String)) ENGINE=MergeTree ORDER BY app;
INSERT INTO test_03093 VALUES ('x1', 123, {'k1': ''});
INSERT INTO test_03093 VALUES ('x1', 123, {'k1': '', 'k11': ''});
INSERT INTO test_03093 VALUES ('x1', 12, {'k1': ''});
SET allow_experimental_analyzer=1;
select app, arrayZip(untuple(sumMap(k.keys, replicate(1, k.keys)))) from test_03093 PREWHERE c > 1 group by app;
select app, arrayZip(untuple(sumMap(k.keys, replicate(1, k.keys)))) from test_03093 WHERE c > 1 group by app;
DROP TABLE IF EXISTS test_03093;