我在BigQuery Jobs API中注意到了复制任务:
developers.google/bigquery/docs/reference/v2/jobs#resource
<对于sourceTables存在一个输入: copy:{sourceTables:[ projectId:string,datasetId:string,tableId:string } ],然而,我们只能定义一个单独的destinationTable而不是destinationTables:
destinationTable:{projectId:string,datasetId:string,tableId:string },有没有一种方法可以使用上述API从一个数据集复制多个源表到另一个数据集?
解决方案要创建多个目标表,您需要运行多个作业。如果您想一次完成这些操作,可以使用批量请求(文档用于HTTP API here 。Python文档此处和Java 此处。
I noticed in BigQuery Jobs API for the Copy task:
developers.google/bigquery/docs/reference/v2/jobs#resource
there exists a input for "sourceTables":
"copy": { "sourceTables": [ { "projectId": string, "datasetId": string, "tableId": string } ],However we can only define a singular "destinationTable" rather than "destinationTables":
"destinationTable": { "projectId": string, "datasetId": string, "tableId": string },Is there a way I can use the above API to copy multiple source tables from one Dataset into another Dataset?
解决方案To create multiple destination tables you'll need to run multiple jobs. If you want to do these all at once, you can use a batch request (docs for the HTTP API here. Python docs are here, and Java here.
更多推荐
使用BigQuery Jobs API复制多个BigQuery表
发布评论