requestPb.setRows(rowsPb);
TableDataInsertAllRequest requestPb = new TableDataInsertAllRequest() .setRows( Lists.transform( rows,
TableDataInsertAllRequest requestPb = new TableDataInsertAllRequest() .setRows( Lists.transform( rows,
TableDataInsertAllRequest requestPb = new TableDataInsertAllRequest() .setRows( Lists.transform( rows,
TableDataInsertAllRequest requestPb = new TableDataInsertAllRequest() .setRows( Lists.transform( rows,
public void insertDataToTable( String projectId, String datasetId, String tableName, List<Map<String, Object>> rows) { try { List<Rows> dataRows = rows.stream().map(row -> new Rows().setJson(row)).collect(Collectors.toList()); this.bqClient .tabledata() .insertAll( projectId, datasetId, tableName, new TableDataInsertAllRequest().setRows(dataRows)) .execute(); LOG.info("Successfully inserted data into table : " + tableName); } catch (Exception e) { LOG.debug("Exceptions caught when inserting data: " + e.getMessage()); } } }
TableDataInsertAllRequest content = new TableDataInsertAllRequest().setRows(rowList); TableDataInsertAllResponse response = bigquery.tabledata().insertAll(projectId, datasetId, tableId, content).execute();
TableDataInsertAllRequest apiRequestData = new TableDataInsertAllRequest().setRows(apiRequestRows);
@Override public InsertAllResponse insertAll(InsertAllRequest request) { final TableId tableId = request.table(); final TableDataInsertAllRequest requestPb = new TableDataInsertAllRequest(); requestPb.setIgnoreUnknownValues(request.ignoreUnknownValues()); requestPb.setSkipInvalidRows(request.skipInvalidRows()); requestPb.setTemplateSuffix(request.templateSuffix()); List<Rows> rowsPb = Lists.transform(request.rows(), new Function<RowToInsert, Rows>() { @Override public Rows apply(RowToInsert rowToInsert) { return new Rows().setInsertId(rowToInsert.id()).setJson(rowToInsert.content()); } }); requestPb.setRows(rowsPb); return InsertAllResponse.fromPb( bigQueryRpc.insertAll(tableId.dataset(), tableId.table(), requestPb)); }
@Override public InsertAllResponse insertAll(InsertAllRequest request) { final TableId tableId = request.table(); final TableDataInsertAllRequest requestPb = new TableDataInsertAllRequest(); requestPb.setIgnoreUnknownValues(request.ignoreUnknownValues()); requestPb.setSkipInvalidRows(request.skipInvalidRows()); requestPb.setTemplateSuffix(request.templateSuffix()); List<Rows> rowsPb = Lists.transform(request.rows(), new Function<RowToInsert, Rows>() { @Override public Rows apply(RowToInsert rowToInsert) { return new Rows().setInsertId(rowToInsert.id()).setJson(rowToInsert.content()); } }); requestPb.setRows(rowsPb); return InsertAllResponse.fromPb( bigQueryRpc.insertAll(tableId.dataset(), tableId.table(), requestPb)); }
|| i == rowsToPublish.size() - 1) { TableDataInsertAllRequest content = new TableDataInsertAllRequest(); content.setRows(rows); content.setSkipInvalidRows(skipInvalidRows); content.setIgnoreUnknownValues(ignoreUnkownValues);
requestPb.setRows(rowsPb);