首页 文章

无法访问类型为ARRAY <STRUCT <hitNumber INT64,时间INT64,小时INT64,... >>的Big Query中的字段

提问于
浏览
24

我正在尝试在BigQuery上使用标准SQL方言(即不是旧版SQL)运行查询 . 我的查询是:

SELECT
date, hits.referer
FROM `refresh.ga_sessions_xxxxxx*`
LIMIT 1000

但不断收到错误

Error: Cannot access field referer on a value with type 
ARRAY<STRUCT<hitNumber INT64, time INT64, hour INT64, ...>> at [2:12]

有人知道正确的语法吗?

1 回答

  • 36

    如果你正在寻找所有的参考者 - 试试

    SELECT date, h.referer
    FROM `refresh.ga_sessions_xxxxxx*`, UNNEST(hits) as h
    

相关问题