_TABLE_SUFFIX丢失?

时间:2019-02-28 09:48:53

标签: sql google-analytics google-bigquery

我正在尝试在BigQuery中使用此代码,显然是从GA提取数据,而_TABLE_SUFFIX似乎有问题。错误消息为“错误:无法识别的名称:_TABLE_SUFFIX,位于[12:3]”,您能帮忙弄清楚为什么吗?

SELECT
fullVisitorId,
visitId,
visitNumber,
hits.hitNumber AS hitNumber,
hits.page.pagePath AS pagePath
FROM
`110042578.ga_sessions_intraday_20190228`,
UNNEST(hits) as hits
WHERE
_TABLE_SUFFIX = '20190228'
AND
hits.type="PAGE"
ORDER BY
fullVisitorId,
visitId,
visitNumber,
hitNumber

1 个答案:

答案 0 :(得分:1)

在表引用中没有通配符*的情况下,没有字段_table_suffix。 试试

SELECT
  fullVisitorId,
  visitId,
  visitNumber,
  hits.hitNumber AS hitNumber,
  hits.page.pagePath AS pagePath
FROM
  `110042578.ga_sessions_intraday_*`,
  UNNEST(hits) as hits
WHERE
  _TABLE_SUFFIX = '20190228'
  AND
  hits.type="PAGE"
ORDER BY
  fullVisitorId,
  visitId,
  visitNumber,
  hitNumber