I'm trying to run a query using Standard SQL Dialect (ie not Legacy SQL) on BigQuery. My query is:
我正在尝试在BigQuery上使用标准SQL方言(即不是遗留SQL)运行查询。我查询的方法是:
SELECT
date, hits.referer
FROM `refresh.ga_sessions_xxxxxx*`
LIMIT 1000
But keep getting the error
但是继续得到误差
Error: Cannot access field referer on a value with type
ARRAY<STRUCT<hitNumber INT64, time INT64, hour INT64, ...>> at [2:12]
Anyone know the proper syntax?
有人知道正确的语法吗?
1 个解决方案
#1
20
if you are looking for all referers - try
如果你正在寻找所有的推荐者-试试
SELECT date, h.referer
FROM `refresh.ga_sessions_xxxxxx*`, UNNEST(hits) as h
#1
20
if you are looking for all referers - try
如果你正在寻找所有的推荐者-试试
SELECT date, h.referer
FROM `refresh.ga_sessions_xxxxxx*`, UNNEST(hits) as h