BigQuery 能否在 Google Cloud Storage 中基于 CSV 文件的外部表中使用通配符?

Posted

技术标签:

【中文标题】BigQuery 能否在 Google Cloud Storage 中基于 CSV 文件的外部表中使用通配符?【英文标题】:Can BigQuery use a wildcard with external tables based on CSV files in Google Cloud Storage? 【发布时间】:2017-06-27 09:40:45 【问题描述】:

我可以使用 BigQuery 中的通配符功能从以 CSV 格式存储在 Google Cloud Storage 上的外部表中进行查询吗?

CSV 文件位于 Google Cloud Storage 存储桶中,并且文件具有不同的分区/数据块,如下所示

org_score_p1
org_score_p2
...
org_score_p99

另外,我预计存储桶中的文件数量会继续增长,因此将以相同的命名方案添加新文件。

【问题讨论】:

【参考方案1】:

是的。但是,您需要确保

您的 Google Cloud Storage 存储分区配置为多区域 您的存储桶的多区域位置设置为与您运行 BigQuery 作业的位置相同。

否则你会得到一个类似这个的错误/异常:

Cannot read and write in different locations: source: US-EAST4, destination: US

【讨论】:

以上是关于BigQuery 能否在 Google Cloud Storage 中基于 CSV 文件的外部表中使用通配符?的主要内容,如果未能解决你的问题,请参考以下文章

使用 Google.Cloud.BigQuery.V2 的 BigQuery 加载作业的幂等性

Python,AttributeError:模块'google.cloud.bigquery'在cx_Freeze构建后没有属性'Client'

Google Cloud Dataproc 删除 BigQuery 表不起作用

BigQuery google.cloud.exceptions.ServiceUnavailable 503

ImportError:无法从“google.cloud”(未知位置)导入名称“bigquery”

setQueryParameters 不是“com.google.cloud”的一部分,名称:“google-cloud-bigquery”,版本:“0.4.0”