Added a test from @baloo-bear #5873

This commit is contained in:
Alexey Milovidov 2020-04-27 00:26:03 +03:00
parent d40fb6b5d3
commit 2f06a7b4c1
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1 @@
['Hello','ProcessName'] ['World','node']

View File

@ -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;