public static final class InsertAllRequest.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
InsertAllRequest.Builder |
addRow(InsertAllRequest.RowToInsert rowToInsert)
Adds a row to be inserted.
|
InsertAllRequest.Builder |
addRow(Map<String,Object> content)
Adds a row to be inserted without an associated id.
|
InsertAllRequest.Builder |
addRow(String id,
Map<String,Object> content)
Adds a row to be inserted with associated id.
|
InsertAllRequest |
build() |
InsertAllRequest.Builder |
ignoreUnknownValues(boolean ignoreUnknownValues)
Sets whether to accept rows that contain values that do not match the schema.
|
InsertAllRequest.Builder |
rows(Iterable<InsertAllRequest.RowToInsert> rows)
Sets the rows to insert as a list of
InsertAllRequest.RowToInsert objects. |
InsertAllRequest.Builder |
skipInvalidRows(boolean skipInvalidRows)
Sets whether to insert all valid rows of a request, even if invalid rows exist.
|
InsertAllRequest.Builder |
table(TableId table)
Sets the destination table for rows insert request.
|
InsertAllRequest.Builder |
templateSuffix(String templateSuffix)
If specified, the destination table is treated as a base template.
|
public InsertAllRequest.Builder table(TableId table)
public InsertAllRequest.Builder rows(Iterable<InsertAllRequest.RowToInsert> rows)
InsertAllRequest.RowToInsert objects.public InsertAllRequest.Builder addRow(InsertAllRequest.RowToInsert rowToInsert)
public InsertAllRequest.Builder addRow(String id, Map<String,Object> content)
Example usage of adding a row with associated id:
InsertAllRequest.Builder builder = InsertAllRequest.builder(tableId);
List<Long> repeatedFieldValue = Arrays.asList(1L, 2L);
Map<String, Object> recordContent = new HashMap<String, Object>();
recordContent.put("subfieldName1", "value");
recordContent.put("subfieldName2", repeatedFieldValue);
Map<String, Object> rowContent = new HashMap<String, Object>();
rowContent.put("fieldName1", true);
rowContent.put("fieldName2", recordContent);
builder.addRow("rowId", rowContent);
public InsertAllRequest.Builder addRow(Map<String,Object> content)
Example usage of adding a row without an associated id:
InsertAllRequest.Builder builder = InsertAllRequest.builder(tableId);
List<Long> repeatedFieldValue = Arrays.asList(1L, 2L);
Map<String, Object> recordContent = new HashMap<String, Object>();
recordContent.put("subfieldName1", "value");
recordContent.put("subfieldName2", repeatedFieldValue);
Map<String, Object> rowContent = new HashMap<String, Object>();
rowContent.put("fieldName1", true);
rowContent.put("fieldName2", recordContent);
builder.addRow(rowContent);
public InsertAllRequest.Builder skipInvalidRows(boolean skipInvalidRows)
public InsertAllRequest.Builder ignoreUnknownValues(boolean ignoreUnknownValues)
public InsertAllRequest.Builder templateSuffix(String templateSuffix)
BigQuery.insertAll(InsertAllRequest)
is called use:
String suffixTableId = ...;
TableInfo suffixTable = bigquery.getTable(DATASET, suffixTableId);
while (suffixTable == null) {
Thread.sleep(1000L);
suffixTable = bigquery.getTable(DATASET, suffixTableId);
}public InsertAllRequest build()
Copyright © 2016 Google. All rights reserved.