我是Java初学者。你能告诉我吗,为什么下面的代码检测到错误,尽管我相信正是因为一个例子,谷歌的以下网址给出了相同的代码: https://developers.google.com/bigquery/streaming-data-into-bigquery#streaminginsertexamples将数据流式传输到BigQuery时出现Java代码错误
字BigQuery是基本为红色,错误是:大量查询不能解决。
我记得我想通过使用tabledata()。insertAll()方法一次将数据流式传输到BigQuery中的一条记录。
这是我的代码:
import java.io.IOException;
import java.util.*;
import com.google.api.services.bigquery.*;
import com.google.api.services.bigquery.model.*;
public class sdz1 {
public static void main(String[] args) {
TableRow row = new TableRow();
row.set("Average", 7.7);
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("Vigicolis", "wi_vigicolis", "TestTable", content)
.execute();
// TableDataInsertAllResponse response = new TableDataInsertAllResponse();
// response.bigquery.tabledata().insertAll("Vigicolis", "wi_vigicolis", "TestTable", content).execute();
System.out.println("Response: " + response);
}
catch (IOException e)
{
// handle
}
}
}