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