/** * Returns a builder for an {@code InsertAllRequest} object given the destination table and the * rows to insert. */ public static Builder builder(TableId table, RowToInsert... rows) { return builder(table, ImmutableList.copyOf(rows)); }
/** * Returns a {@code InsertAllRequest} object given the destination table and the rows to insert. */ public static InsertAllRequest of(String datasetId, String tableId, RowToInsert... rows) { return builder(datasetId, tableId, rows).build(); }
/** * Returns a builder for an {@code InsertAllRequest} object given the destination table and the * rows to insert. */ public static Builder builder(TableInfo tableInfo, Iterable<RowToInsert> rows) { return builder(tableInfo.tableId(), rows); }
/** * Returns a {@code InsertAllRequest} object given the destination table and the rows to insert. */ public static InsertAllRequest of(TableId tableId, RowToInsert... rows) { return builder(tableId, rows).build(); }
/** * Returns a {@code InsertAllRequest} object given the destination table and the rows to insert. */ public static InsertAllRequest of(String datasetId, String tableId, Iterable<RowToInsert> rows) { return builder(datasetId, tableId, rows).build(); }
/** * Returns a builder for an {@code InsertAllRequest} object given the destination table and the * rows to insert. */ public static Builder builder(String datasetId, String tableId, Iterable<RowToInsert> rows) { return builder(TableId.of(datasetId, tableId), rows); }
/** * Returns a {@code InsertAllRequest} object given the destination table and the rows to insert. */ public static InsertAllRequest of(TableId tableId, Iterable<RowToInsert> rows) { return builder(tableId, rows).build(); }
/** * Returns a builder for an {@code InsertAllRequest} object given the destination table and the * rows to insert. */ public static Builder builder(TableId table, Iterable<RowToInsert> rows) { return builder(table).rows(rows); }
/** * Returns a builder for an {@code InsertAllRequest} object given the destination table and the * rows to insert. */ public static Builder builder(String datasetId, String tableId, RowToInsert... rows) { return builder(TableId.of(datasetId, tableId), rows); }
/** * Returns a builder for an {@code InsertAllRequest} object given the destination table and the * rows to insert. */ public static Builder builder(TableInfo tableInfo, RowToInsert... rows) { return builder(tableInfo.tableId(), rows); }
/** * Returns a {@code InsertAllRequest} object given the destination table and the rows to insert. */ public static InsertAllRequest of(TableInfo tableInfo, Iterable<RowToInsert> rows) { return builder(tableInfo.tableId(), rows).build(); }
/** * Returns a {@code InsertAllRequest} object given the destination table and the rows to insert. */ public static InsertAllRequest of(TableInfo tableInfo, RowToInsert... rows) { return builder(tableInfo.tableId(), rows).build(); }
/** * Insert rows into the table. * * @param rows rows to be inserted * @param skipInvalidRows whether to insert all valid rows, even if invalid rows exist. If not set * the entire insert operation will fail if rows to be inserted contain an invalid row * @param ignoreUnknownValues whether to accept rows that contain values that do not match the * schema. The unknown values are ignored. If not set, rows with unknown values are considered * to be invalid * @throws BigQueryException upon failure */ public InsertAllResponse insert(Iterable<InsertAllRequest.RowToInsert> rows, boolean skipInvalidRows, boolean ignoreUnknownValues) throws BigQueryException { InsertAllRequest request = InsertAllRequest.builder(tableId(), rows) .skipInvalidRows(skipInvalidRows) .ignoreUnknownValues(ignoreUnknownValues) .build(); return bigquery.insertAll(request); }