使用BigQuery Jobs API复制多个BigQuery表

编程入门 行业动态 更新时间:2024-10-10 13:24:54
本文介绍了使用BigQuery Jobs API复制多个BigQuery表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在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表

本文发布于:2023-11-24 00:35:49,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   BigQuery   Jobs   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!