BigQuery View 可以引用来自不同 datasets/projects 的其他表和视图吗?
Can BigQuery View reference other Tables and Views from different datasets/projects?
根据BigQuery Views docs:"Also, views can only reference other tables and views with the same Dataset location."
但实际上我可以这样创建一个视图(查询只是为了举例):
SELECT a.body
FROM [fh-bigquery:reddit_comments.2008] as a
inner JOIN flatten([bigquery-samples:playlists.playlists],tracks.data)
as b ON a.author=b.tracks.data.artist.name
然后像正常一样在查询中引用此视图 table:
SELECT * FROM [flow-1202:alex_centre.test_v_501] LIMIT 1000
而且有效。
在 BigQuery 中使用视图而不是子查询时是否有更多限制?
在您引用的引文中 - 关键字是 "location"!
您不能在同一视图中从不同位置引用 tables/views
在此处查看有关数据集位置的更多信息 - https://cloud.google.com/bigquery/docs/managing_jobs_datasets_projects#datasets
在您问题的示例中 - 两个表都在我们的位置 - 因此有效!
根据BigQuery Views docs:"Also, views can only reference other tables and views with the same Dataset location."
但实际上我可以这样创建一个视图(查询只是为了举例):
SELECT a.body
FROM [fh-bigquery:reddit_comments.2008] as a
inner JOIN flatten([bigquery-samples:playlists.playlists],tracks.data)
as b ON a.author=b.tracks.data.artist.name
然后像正常一样在查询中引用此视图 table:
SELECT * FROM [flow-1202:alex_centre.test_v_501] LIMIT 1000
而且有效。
在 BigQuery 中使用视图而不是子查询时是否有更多限制?
在您引用的引文中 - 关键字是 "location"!
您不能在同一视图中从不同位置引用 tables/views
在此处查看有关数据集位置的更多信息 - https://cloud.google.com/bigquery/docs/managing_jobs_datasets_projects#datasets
在您问题的示例中 - 两个表都在我们的位置 - 因此有效!