I am trying to update the hits.page.pagePath field in the Google Analytics export in BigQuery, however i\'m unable to unnest the field using the method outlined in the docum
Below is for BigQuery Standard SQL
UPDATE `project-name.datasetId.ga_sessions_yyyymmdd`
SET hits = ARRAY(
SELECT AS STRUCT * REPLACE(
(SELECT AS STRUCT *
REPLACE('Your New pagePath' AS pagePath)
FROM UNNEST([page])
) AS page)
FROM UNNEST(hits)
)
WHERE fullVisitorID like "%1%"
As you can see in above example you would replace pagePath with string 'Your New pagePath'
Of course in reality you would want to have some logic here - so replace that part to whatever logic you need - like for example you would need to UPPER whole string - you would use something like below
REPLACE(UPPER(pagePath) AS pagePath)