how can I query a column with arrays and replace the array with a value from a corresponding table? In below example, i would want to replace the people column by an array of string names instead of id's
CREATE TEMPORARY TABLE somestats
(
not_unique String,
people Array(UInt32)
);
INSERT INTO somestats (not_unique, people) VALUES
('FUNEVENT', [1, 2, 3]),
('FUNEVENT', [1, 3]),
('OTHEREVENT', []);
CREATE TEMPORARY TABLE person
(
id UInt32,
name String
);
INSERT INTO person (id, name) VALUES
(1, 'John'),
(2, 'Jane'),
(3, 'Doe');
resulting query should output e.g.
(1, ["John", "Jane", "Doe"]),
(2, ["John", "Doe"]),
(3, []);
the solution should ideally use ArrayMap and not need a group by clause.
Consider using Dictionaries to access
personby useful way: