TableDataInsertAllRequest.Rows out = new TableDataInsertAllRequest.Rows(); if (idsToPublish != null) { out.setInsertId(idsToPublish.get(i)); out.setJson(row.getUnknownKeys()); rows.add(out);
row.set("Column3", "OneMoreCol2"); TableDataInsertAllRequest.Rows rows = new TableDataInsertAllRequest.Rows(); rows.setJson(row); List rowList = new ArrayList(); rowList.add(rows);
TableDataInsertAllRequest.Rows requestRow = new TableDataInsertAllRequest.Rows(); requestRow.setJson(row); requestRow.setInsertId(insertId); rowList.add(requestRow);
private TableDataInsertAllRequest.Rows createRowRequest(Exchange exchange, Map<String, Object> object) { TableRow tableRow = new TableRow(); tableRow.putAll(object); String insertId = null; if (configuration.getUseAsInsertId() != null) { insertId = (String)(object.get(configuration.getUseAsInsertId())); } else { if (exchange != null) { insertId = exchange.getIn().getHeader(GoogleBigQueryConstants.INSERT_ID, String.class); } } TableDataInsertAllRequest.Rows rows = new TableDataInsertAllRequest.Rows(); rows.setInsertId(insertId); rows.setJson(tableRow); return 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()); } } }
@Override public Rows apply(RowToInsert rowToInsert) { allInsertIdsSet[0] &= rowToInsert.getId() != null; return new Rows() .setInsertId(rowToInsert.getId()) .setJson(rowToInsert.getContent()); } })
@Override public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { return new TableDataInsertAllRequest.Rows() .setInsertId(rowToInsert.getId()) .setJson(rowToInsert.getContent()); } }))
@Override public Rows apply(RowToInsert rowToInsert) { allInsertIdsSet[0] &= rowToInsert.getId() != null; return new Rows() .setInsertId(rowToInsert.getId()) .setJson(rowToInsert.getContent()); } })
@Override public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { return new TableDataInsertAllRequest.Rows() .setInsertId(rowToInsert.getId()) .setJson(rowToInsert.getContent()); } }))
@Override public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { return new TableDataInsertAllRequest.Rows() .setInsertId(rowToInsert.getId()) .setJson(rowToInsert.getContent()); } }))
@Override public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { return new TableDataInsertAllRequest.Rows() .setInsertId(rowToInsert.getId()) .setJson(rowToInsert.getContent()); } }))