clickhouse 函数
基础函数
ARRAY JOIN(类似于hive:explode)
drop table tb_user_info;
CREATE TABLE tb_user_info
(
`id` UInt8,
`name` String,
`age` Int,
`hobbys` Array(String)
) ENGINE = MergeTree()
ORDER BY id;
INSERT INTO table tb_user_info
VALUES (1, ' zs', 18, ['study', 'sport']),
(2, ' ls', 19, ['eat', 'drink','seleep']),
(3, ' ww', 20, ['run']);
SELECT id,
name,
age,
hobby
FROM tb_user_info
ARRAY JOIN hobbys as hobby;
arrayEnumerate(类似于hive:row_number)
SELECT id,
name,
age,
hobby,
idx
FROM tb_user_info
ARRAY JOIN
hobbys as hobby,
arrayEnumerate(hobbys) as idx;