BigQuery:通过Java API进行流式插入时出现错误500 [英] BigQuery: Error 500 on streaming insert via Java API

查看:102
本文介绍了BigQuery:通过Java API进行流式插入时出现错误500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图使用此示例代码插入一行: data-into-bigquery#streaminginsertexamplesrel =nofollow noreferrer> https://developers.google.com/bigquery/streaming-data-into-bigquery#streaminginsertexamples

  TableRow row = new TableRow(); 
row.set(Col1,50);
row.set(Col2,50);
TableDataInsertAllRequest.Rows rows = new TableDataInsertAllRequest.Rows();
rows.setInsertId(+ System.currentTimeMillis());
rows.setJson(row);
列表rowList = new ArrayList();
rowList.add(rows);
TableDataInsertAllRequest content = new TableDataInsertAllRequest()。setRows(rowList);
try
{
TableDataInsertAllResponse response =
bigquery
.tabledata()
.insertAll(< myprojectid>,6bc2cf53x8684x42a4x8149x9ff20fa8beed,TestTable ,content)
.execute();

System.out.println(Response:+ response);

catch(IOException e)
{
//句柄
}

模式是这样的:

  Col1 INTEGER NULLABLE 
Col2 INTEGER NULLABLE

我收到一个错误:

<$ p $ com.google.api.client.googleapis.json.GoogleJsonResponseException:500
{
code:500,
errors:[{
domain:global,
message:意外,请重试。,
reason:internalError
}],
消息:意外,请重试。





$ b

项目存在,数据集存在,表存在,数据类型与列spec相匹配,我正在使用示例代码。约旦在这个问题上说[1] 500意味着一个BigQuery错误。我不介意解决它(如果是这样),但我不知道如何。我可以尝试什么?我为每个列硬编码了简单的值,我尝试了不同的表格,我尝试了一个不同的全新项目/数据集/表集。相同的结果。

这是在开发或GAE环境。



如果有帮助:

>

项目编号:1066943214796(注意我没有使用这个,我在调用中使用字符串ID),datasetid和表现在在上面的代码中。



[1] 请求谷歌大查询API使用服务帐户时发生HTTP错误500

重现和识别问题!

我得到完全相同的错误,除非我重命名数据集。在将6bc2cf53x8684x42a4x8149x9ff20fa8beed更改为现有的更简单的字符串后,这一切都奏效了。

您可以尝试使用其他数据集名称吗?我将提交一个错误,以发现为什么在此期间发生。


I'm trying to insert a row using this example code:

https://developers.google.com/bigquery/streaming-data-into-bigquery#streaminginsertexamples

TableRow row = new TableRow();
row.set("Col1", 50);
row.set("Col2", 50);
TableDataInsertAllRequest.Rows rows = new TableDataInsertAllRequest.Rows();
rows.setInsertId("" + System.currentTimeMillis());
rows.setJson(row);
List rowList = new ArrayList();
rowList.add(rows);
TableDataInsertAllRequest content = new TableDataInsertAllRequest().setRows(rowList);
try
{
  TableDataInsertAllResponse response =
      bigquery
      .tabledata()
      .insertAll("<myprojectid>", "6bc2cf53x8684x42a4x8149x9ff20fa8beed", "TestTable", content)
      .execute();

  System.out.println("Response: " + response);
}
catch (IOException e)
{
  // handle
}

Schema is this:

Col1 INTEGER NULLABLE
Col2 INTEGER NULLABLE

I'm receiving an error:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 500
{
  "code" : 500,
  "errors" : [ {
    "domain" : "global",
    "message" : "Unexpected. Please try again.",
    "reason" : "internalError"
  } ],
  "message" : "Unexpected. Please try again."
}

Project exists, dataset exists, table exists, data types match the column spec, and I'm using the example code. Jordan said on this question [1] that 500 means a BigQuery bug. I don't mind working around it (if that's it) but I have no idea how to. What can I try? I've hardcoded simple values for each column, I've tried a different table, I've tried a different, brand-new project/dataset/table set. Same result.

This is both on the dev or GAE environment.

If it helps:

Project number: 1066943214796 (note I'm not using that, I'm using the string id in the call), datasetid and table now in the code above.

[1] HTTP error 500 when requesting google big query API using service account

解决方案

I was able to reproduce and identify the problem!

I get the exact same error, unless I rename the dataset. After I changed "6bc2cf53x8684x42a4x8149x9ff20fa8beed" to an existing, simpler string, it all worked.

Can you try a different dataset name? I'll file a bug to discover why this is happening in the meantime.

这篇关于BigQuery:通过Java API进行流式插入时出现错误500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆