-
Understanding SQL Server parsing of GA4 BigQuery RECORD columns
I’m using a Python script to pull daily GA4 event files from BigQuery and save them to a SQL Server DW. It’s mostly easy because the columns are Strings or Integers. But there are 11 fields of type RECORD which are kind of a headache. According to Google, RECORDS are storable as STRUCT type in GoogleSQL and sometimes show up as arrays. Have a look at these samples of ‘event_params’ data, which is an array of STRUCT types, and ‘device’ data, which is a STRUCT. Can anyone show me a SQL function that can parse STRUCTS or arrays of STRUCTS? Is there a way to cast this data as JSON so I can use the built-in JSON functions to query it?
Log in to reply.