我是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
}
}
}