Scala BigQueryException:超出API限制
我使用BigQueryJavaAPI与WriteDisposition WRITE_APPEND同时运行约1000个拷贝作业(使用scala.concurrent.Future),但我得到了Scala BigQueryException:超出API限制,scala,google-bigquery,Scala,Google Bigquery,我使用BigQueryJavaAPI与WriteDisposition WRITE_APPEND同时运行约1000个拷贝作业(使用scala.concurrent.Future),但我得到了 com.google.cloud.bigquery.BigQueryException: API limit exceeded: Unable to return a row that exceeds the API limits. To retrieve the row, export the table
com.google.cloud.bigquery.BigQueryException: API limit exceeded: Unable to return a row that exceeds the API limits. To retrieve the row, export the table
我认为这是由于并发太多造成的,然后我尝试使用Monix的任务将并行性限制为最多20:
def execute(queries: List[Query]): Future[Seq[Boolean]] = {
val tasks: Iterator[Task[List[Boolean]]] = queries.map(q => BqApi.copyTable(q, destinationTable))
.sliding(20, 20)
.map(Task.gather(_))
val results: Task[List[Boolean]] = Task.sequence(tasks)
.map(_.flatten.toList)
results.runAsync
}
其中BqApi.copyTable执行查询并将结果复制到目标表,然后返回一个任务[Boolean]
同样的例外情况仍在发生
但是如果我将WriteDisposition更改为WRITE_TRUNCATE,异常就会消失
有人能帮我了解引擎盖下发生了什么吗?为什么Bigquery API的行为是这样的?当查询超过最大响应大小时,会遇到此消息。由于复制作业使用
作业。插入
,可能您遇到了查询作业限制中的问题。我建议在its上填充一个BigQuery bug,以正确描述您关于Java API的行为。谢谢您的回复,但是如果我将WriteDisposition设置为WRITE_TRUNCATE,则不会出现异常,因此,“超出最大行大小”假设可能无效,因为这两种情况下的查询部分是相同的。由于WRITE_TRUNCATE会覆盖表数据,并且使用此选项无法获得API limit消息,因此我建议BigQuery团队检查此行为。