BigQuery - 使用2个不同的分区运行查询

时间:2014-12-22 22:42:34

标签: google-bigquery

我正在尝试使用2个不同的分区运行查询。区别在于一个分区是排序的,另一个不是(下面的查询只是说明了问题,它没有意义)

SELECT 
  repository.forks forks,
  repository.fork fork,
  row_number() over (partition by repository.url order by repository.created_at ) r,
  count (repository.fork) over (partition by repository.url) cnt,
FROM [publicdata:samples.github_nested] LIMIT 1000

当我运行上面的查询时,我得到一个奇怪的错误:     田野'叉子'没有找到;你是说'叉'吗?

删除其中一个窗口函数时,查询工作正常。

是否可以使用2个不同的分区运行查询?

1 个答案:

答案 0 :(得分:3)

如何写作:

SELECT 
  repository.forks ,
  repository.fork ,
  row_number() over (partition by repository.url order by repository.created_at ) r,
  count (repository.fork) over (partition by repository.url) cnt,
FROM [publicdata:samples.github_nested] LIMIT 1000
相关问题