Flattening Google Analytics data (with repeated fields) not working anymore

后端 未结 5 1983
情话喂你
情话喂你 2020-12-16 16:54

We have a premium Google Analytics account, which will give us access to row level event data. This data is exported daily to Google Bigquery and for every day a new table w

5条回答
  •  孤城傲影
    2020-12-16 17:12

    You have to use flatten the query before connecting. Simply pick the fields that are mentioned in the error and use the nested flattening:

    SELECT * FROM 
    flatten(flatten(flatten([xxxxxxxx.ga_sessions_20140829],hits),customDimensions_value),hits_product_productSKU),
    flatten(flatten(flatten([xxxxxxxx.ga_sessions_20140828],hits),customDimensions_value),hits_product_productSKU),
    flatten(flatten(flatten([xxxxxxxx.ga_sessions_20140827],hits),customDimensions_value),hits_product_productSKU),    flatten(flatten(flatten([xxxxxxxx.ga_sessions_20140826],hits),customDimensions_value),hits_product_productSKU)
    

提交回复
热议问题