我正在尝试从 Big Query 中的重复字段中展平数据。我看过这个在 BigQuery 中查询多个重复字段,但是我似乎无法让它工作。
我的数据如下所示:
[
{
"visitorId": null,
"visitNumber": "15",
"device": {
"browser": "Safari (in-app)",
"browserVersion": "(not set)",
"browserSize": "380x670",
"operatingSystem": "iOS",
},
"hits": [
{
"isEntrance": "true",
"isExit": "true",
"referer": null,
"page": {
"pagePath": "/news/bla-bla-bla",
"hostname": "www.example.com",
"pageTitle": "Win tickets!!",
"searchKeyword": null,
"searchCategory": null,
"pagePathLevel1": "/news/",
"pagePathLevel2": "/bla-bla-bla",
"pagePathLevel3": "",
"pagePathLevel4": ""
},
"transaction": null
}
]
}
]
我想要的是点击页面重复字段中的字段。
例如,我想获取 hits.page.pagePath(值为“/news/bla-bla-bla”)
我已尝试使用以下查询,但出现错误:
SELECT
visitorId,
visitNumber,
device.browser,
hits.page.pagePath
FROM
`Project.Page`
LIMIT 1000
我得到的错误是这个
Error: Cannot access field page on a value with type ARRAY<STRUCT<hitNumber INT64, time INT64, hour INT64, ...>>