Skip to content

Instantly share code, notes, and snippets.

@smzn
Created August 1, 2018 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smzn/5e42ff2c448eaf8d63ca056ca7d0211c to your computer and use it in GitHub Desktop.
Save smzn/5e42ff2c448eaf8d63ca056ca7d0211c to your computer and use it in GitHub Desktop.
insertTotals
public void insertTotals(TableResult response, int index){
System.out.println("Totals : Insert開始");
for (FieldValueList row : response.iterateAll()) {
Map<String, Object> rowvalue = new HashMap<>();
for(int i = 0; i < column; i++) {
rowvalue.put("sum"+i, row.get("sum"+i).getValue());
}
rowvalue.put("index", index);
InsertAllRequest insertRequest = InsertAllRequest.newBuilder(tableId).addRow(rowvalue).build();
InsertAllResponse insertResponse = bigQuery.insertAll(insertRequest);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment