From 2f06a7b4c15ec2549d18f63c2fe1f8d1b65b7ce4 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 27 Apr 2020 00:26:03 +0300 Subject: [PATCH] Added a test from @baloo-bear #5873 --- .../01264_nested_baloo_bear.reference | 1 + .../0_stateless/01264_nested_baloo_bear.sql | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 tests/queries/0_stateless/01264_nested_baloo_bear.reference create mode 100644 tests/queries/0_stateless/01264_nested_baloo_bear.sql diff --git a/tests/queries/0_stateless/01264_nested_baloo_bear.reference b/tests/queries/0_stateless/01264_nested_baloo_bear.reference new file mode 100644 index 00000000000..dcd755331c4 --- /dev/null +++ b/tests/queries/0_stateless/01264_nested_baloo_bear.reference @@ -0,0 +1 @@ +['Hello','ProcessName'] ['World','node'] diff --git a/tests/queries/0_stateless/01264_nested_baloo_bear.sql b/tests/queries/0_stateless/01264_nested_baloo_bear.sql new file mode 100644 index 00000000000..ae9b02866c0 --- /dev/null +++ b/tests/queries/0_stateless/01264_nested_baloo_bear.sql @@ -0,0 +1,39 @@ +DROP TABLE IF EXISTS LOG_T; + +CREATE TABLE LOG_T +( + `fingerprint` UInt64, + `fields` Nested( + name LowCardinality(String), + value String) +) +ENGINE = MergeTree +ORDER BY fingerprint; + +SELECT + fields.name, + fields.value +FROM +( + SELECT + fields.name, + fields.value + FROM LOG_T +) +WHERE has(['node'], fields.value[indexOf(fields.name, 'ProcessName')]); + +INSERT INTO LOG_T VALUES (123, ['Hello', 'ProcessName'], ['World', 'node']); + +SELECT + fields.name, + fields.value +FROM +( + SELECT + fields.name, + fields.value + FROM LOG_T +) +WHERE has(['node'], fields.value[indexOf(fields.name, 'ProcessName')]); + +DROP TABLE LOG_T;