I am working with a dbt (redshift) model which has a column named data, of super datatype and looks like this: {"browser":"Chrome","browserVersion":"119.0.0.0","country":"US","deviceCategory":"desktop","isInTrial":"False","isLoggedIn":"True","language":"en","operatingSystem":"Windows NT 10.0","planType":"free","variantId":"1"}
I am trying to unnest some of the data, into new columns, but I cannot find a way to do so for the nodes which have a capital letter within their name.
When creating new columns from this model, I use the function: cast(properties.country as varchar) as country
, which work just fine. But when I want to extract nodes which have a capital letter, it does not work, and gives null value, like for example cast(properties.variantId as varchar) as varian_id
. When I run this line of code in an sql client, reading directly from the datawharehouse, it works fine if i modify the script like this: cast(properties."variantId" as varchar) as varian_id
. But, when I build the model in dbt, it will again give me null values, despite the fact that there are values.