From 5c01cc512d15a0fdb8543d79cd5c72914565ada9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Wed, 21 Feb 2024 18:31:55 +0100 Subject: [PATCH] Add test for 60232 --- .../02998_analyzer_prewhere_report.reference | 1 + .../02998_analyzer_prewhere_report.sql | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/queries/0_stateless/02998_analyzer_prewhere_report.reference create mode 100644 tests/queries/0_stateless/02998_analyzer_prewhere_report.sql diff --git a/tests/queries/0_stateless/02998_analyzer_prewhere_report.reference b/tests/queries/0_stateless/02998_analyzer_prewhere_report.reference new file mode 100644 index 00000000000..3ae61a44a3f --- /dev/null +++ b/tests/queries/0_stateless/02998_analyzer_prewhere_report.reference @@ -0,0 +1 @@ +2024-01-01 [2,3] diff --git a/tests/queries/0_stateless/02998_analyzer_prewhere_report.sql b/tests/queries/0_stateless/02998_analyzer_prewhere_report.sql new file mode 100644 index 00000000000..b3027181901 --- /dev/null +++ b/tests/queries/0_stateless/02998_analyzer_prewhere_report.sql @@ -0,0 +1,18 @@ +--https://github.com/ClickHouse/ClickHouse/issues/60232 +CREATE TABLE hits +( + `date` Date, + `data` Array(UInt32) +) +ENGINE = MergeTree +PARTITION BY toYYYYMM(date) +ORDER BY date; + +INSERT INTO hits values('2024-01-01', [1, 2, 3]); + +SELECT + hits.date, + arrayFilter(x -> (x IN (2, 3)), data) AS filtered +FROM hits +WHERE arrayExists(x -> (x IN (2, 3)), data) +SETTINGS allow_experimental_analyzer = 1;