i have a column "device" which has rows json values like this
| device |
|---|
| {"brand_name":'huawei,'brand_id':'1232',''country:'china'} |
| {"brand_name":'sony,'brand_id':'1ds232',''country:'japan'} |
i want to create a column for every element inside the json like this
| brand_name | brand_id | country |
|---|---|---|
| huawei | 1232 | china |
| sony | 1ds232 | japan |
In a standard SQL i have done like this,
Select
device.brand_name
device.brand_id
device.country
From table
I want to do this in clickhouse and In this case JSON only have three values ( brand_name,brand_id, country) but what if the JSON have n number of values , so what i want to do is instead of accessing every value in JSON by device.brand_name,device.brand_id....etc , I want to loop all the values inside it and make it as a column
In standard SQL i have achieved with this
Select
device.*
From table
, is there a way to do it in clickhouse? , thank you