how to convert an array into single column in clickhouse?

51 Views Asked by At

since i cant use conditions with ARRAY JOIN, i have to JOIN two tables and i can't find how to convert a simple array to a column.

WITH
    ['filter', 'words'] as filter_words
...

i tried this but id didn't work

WITH
    filter_words as (
        select arrayJoin(['%filter%', '%words%']) as filter_word
    )
1

There are 1 best solutions below

0
Derek Chia On BEST ANSWER

You can use this to convert a simple array to a column:

clickhouse-cloud :) WITH
    ['filter', 'words'] as filter_words
SELECT arrayJoin(filter_words) as col from system.one



WITH ['filter', 'words'] AS filter_words
SELECT arrayJoin(filter_words) AS col
FROM system.one

Query id: c86602c8-682d-469d-b2fe-75647321bf63

┌─col────┐
│ filter │
│ words  │
└────────┘