BigQuery错误:在ga_realtime_sessions的视图上,例程参考错误“ OFFSET”

时间:2018-08-16 14:38:48

标签: google-bigquery

基于该线程,我在Google Analytics(分析)填充的表ga_realtime_sessions中的标准SQL中有一个名为“ ga_realtime_view”的视图:

change view ga_realtime_sessions_view_YYYYMMDD to standard sql

此视图基于以下查询:

SELECT
  _TABLE_SUFFIX AS suffix,
  ARRAY_AGG(t ORDER BY exportTimeUsec DESC LIMIT 1)[OFFSET(0)].*
FROM `PROJECT.DATASET.ga_realtime_sessions_20*` AS t
GROUP BY suffix, t.visitKey

我几个月来一直在查询此视图,没有任何问题,但是今天它变得不稳定。我的查询有时会收到错误:

Error: Bad routine reference "OFFSET"; routine references in standard SQL views require explicit project IDs.

有时候,当我按下“运行”时,会出现此错误,而查询无法运行。
有时,我点击“运行”,查询会一直运行到最后,并且得到结果时出现错误。

我的查询:

SELECT "France" as country,
EXTRACT(HOUR FROM TIMESTAMP_SECONDS(visitStartTime) AT TIME ZONE "Europe/Paris") AS hour,
SUM(totals.visits) as sessions,
SUM(totals.transactions) as transactions
FROM `PROJECT.DATASET.ga_realtime_view` 
GROUP BY hour
ORDER BY hour

我不知道发生了什么,有人知道吗?
谢谢

0 个答案:

没有答案