I have column called uf
that contains an array of JSON objects. Here is a mockup:
[
{"type": "browserId", "name": "", "value": "unknown"},
{"type": "campaign", "name": "", "value": "om_227dec0082a5"},
{"type": "custom", "name": "2351350529", "value": "10148"},
{"type": "custom", "name": "9501713387", "value": "true"},
{"type": "custom", "name": "9517735577", "value": "true"},
{"type": "custom", "name": "9507402548", "value": "true"},
{"type": "custom", "name": "9733902068", "value": "true"}
]
I'm trying to get this as child records but for some reason I can't find the right way to unnest it first. Then I noticed that my whole array is wrapped into another JSON object..
This is where I'm at:
I tried simple select and noticed that the result is:
[{type=[{"type": "browserId", "name": "", "value": "ff"}, name=null, value=null}]
The definition for this column is as follows:
{
"Name": "uf",
"Type": "array<struct<type:string,name:string,value:string>>"
}
Is the definition incorrect and that's why I get my whole array wrapped in another json array?
-- edit
Here is the example of my csv file (tab delimited). Spent last two days trying to see if it's something about JSON that makes Glue not recognise column as array of JSON but I created a new column with simple array of JSON that was correctly assigned as array<struct
but after querying I was getting exactly the same problem as above
timestamp project_id campaign_id experiment_id variation_id layer_holdback audience_names end_user_id uuid session_id snippet_revision user_ip user_agent user_engine user_engine_version referer global_holdback event_type event_name uf active_views event_features event_metrics event_uuid
1570326511 74971132 11089500404 11097730080 11078120202 false [] oeu1535997971348r0.4399811351004357 AUTO 6540 5.91.170.0 Mozilla/5.0 (Linux; Android 7.0; SAMSUNG SM-G925F Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.2 Chrome/67.0.3396.87 Mobile Safari/537.36 js 0.128.0 https://www.zavamed.com/uk/account/ false view_activated 10832783364 [{"type": "browserId", "name": "", "value": "unknown"}, {"type": "device", "name": "", "value": "mobile"}, {"type": "device_type", "name": "", "value": "phone"}, {"type": "referrer", "name": "", "value": "https:\/\/www.google.co.uk\/"}, {"type": "source_type", "name": "", "value": "campaign"}, {"type": "currentTimestamp", "name": "", "value": "-1631518596"}, {"type": "offset", "name": "", "value": "-60"}] [] [] [] 4926a5f1-bbb5-4553-9d0b-b26f773fa0f4