Class InsertAllRequest (2.51.0)

publicfinalclass InsertAllRequestimplementsSerializable

Google Cloud BigQuery insert all request. This class can be used to stream data into BigQuery one record at a time without needing to run a load job. This approach enables querying data without the delay of running a load job. There are several important trade-offs to consider before choosing an approach. See Also: Streaming Data into BigQuery

Inheritance

Object > InsertAllRequest

Implements

Serializable

Static Methods

newBuilder(TableId table)

publicstaticInsertAllRequest.BuildernewBuilder(TableIdtable)

Returns a builder for an InsertAllRequest object given the destination table.

Parameter
Name Description
table TableId
Returns
Type Description
InsertAllRequest.Builder

newBuilder(TableId table, InsertAllRequest.RowToInsert[] rows)

publicstaticInsertAllRequest.BuildernewBuilder(TableIdtable,InsertAllRequest.RowToInsert[]rows)

Returns a builder for an InsertAllRequest object given the destination table and the rows to insert.

Parameters
Name Description
table TableId
rows RowToInsert[]
Returns
Type Description
InsertAllRequest.Builder

newBuilder(TableId table, Iterable<InsertAllRequest.RowToInsert> rows)

publicstaticInsertAllRequest.BuildernewBuilder(TableIdtable,Iterable<InsertAllRequest.RowToInsert>rows)

Returns a builder for an InsertAllRequest object given the destination table and the rows to insert.

Parameters
Name Description
table TableId
rows Iterable<RowToInsert>
Returns
Type Description
InsertAllRequest.Builder

newBuilder(TableInfo tableInfo, InsertAllRequest.RowToInsert[] rows)

publicstaticInsertAllRequest.BuildernewBuilder(TableInfotableInfo,InsertAllRequest.RowToInsert[]rows)

Returns a builder for an InsertAllRequest object given the destination table and the rows to insert.

Parameters
Name Description
tableInfo TableInfo
rows RowToInsert[]
Returns
Type Description
InsertAllRequest.Builder

newBuilder(TableInfo tableInfo, Iterable<InsertAllRequest.RowToInsert> rows)

publicstaticInsertAllRequest.BuildernewBuilder(TableInfotableInfo,Iterable<InsertAllRequest.RowToInsert>rows)

Returns a builder for an InsertAllRequest object given the destination table and the rows to insert.

Parameters
Name Description
tableInfo TableInfo
rows Iterable<RowToInsert>
Returns
Type Description
InsertAllRequest.Builder

newBuilder(String datasetId, String tableId)

publicstaticInsertAllRequest.BuildernewBuilder(StringdatasetId,StringtableId)

Returns a builder for an InsertAllRequest object given the destination table.

Parameters
Name Description
datasetId String
tableId String
Returns
Type Description
InsertAllRequest.Builder

newBuilder(String datasetId, String tableId, InsertAllRequest.RowToInsert[] rows)

publicstaticInsertAllRequest.BuildernewBuilder(StringdatasetId,StringtableId,InsertAllRequest.RowToInsert[]rows)

Returns a builder for an InsertAllRequest object given the destination table and the rows to insert.

Parameters
Name Description
datasetId String
tableId String
rows RowToInsert[]
Returns
Type Description
InsertAllRequest.Builder

newBuilder(String datasetId, String tableId, Iterable<InsertAllRequest.RowToInsert> rows)

publicstaticInsertAllRequest.BuildernewBuilder(StringdatasetId,StringtableId,Iterable<InsertAllRequest.RowToInsert>rows)

Returns a builder for an InsertAllRequest object given the destination table and the rows to insert.

Parameters
Name Description
datasetId String
tableId String
rows Iterable<RowToInsert>
Returns
Type Description
InsertAllRequest.Builder

of(TableId tableId, InsertAllRequest.RowToInsert[] rows)

publicstaticInsertAllRequestof(TableIdtableId,InsertAllRequest.RowToInsert[]rows)

Returns a InsertAllRequest object given the destination table and the rows to insert.

Parameters
Name Description
tableId TableId
rows RowToInsert[]
Returns
Type Description
InsertAllRequest

of(TableId tableId, Iterable<InsertAllRequest.RowToInsert> rows)

publicstaticInsertAllRequestof(TableIdtableId,Iterable<InsertAllRequest.RowToInsert>rows)

Returns a InsertAllRequest object given the destination table and the rows to insert.

Parameters
Name Description
tableId TableId
rows Iterable<RowToInsert>
Returns
Type Description
InsertAllRequest

of(TableInfo tableInfo, InsertAllRequest.RowToInsert[] rows)

publicstaticInsertAllRequestof(TableInfotableInfo,InsertAllRequest.RowToInsert[]rows)

Returns a InsertAllRequest object given the destination table and the rows to insert.

Parameters
Name Description
tableInfo TableInfo
rows RowToInsert[]
Returns
Type Description
InsertAllRequest

of(TableInfo tableInfo, Iterable<InsertAllRequest.RowToInsert> rows)

publicstaticInsertAllRequestof(TableInfotableInfo,Iterable<InsertAllRequest.RowToInsert>rows)

Returns a InsertAllRequest object given the destination table and the rows to insert.

Parameters
Name Description
tableInfo TableInfo
rows Iterable<RowToInsert>
Returns
Type Description
InsertAllRequest

of(String datasetId, String tableId, InsertAllRequest.RowToInsert[] rows)

publicstaticInsertAllRequestof(StringdatasetId,StringtableId,InsertAllRequest.RowToInsert[]rows)

Returns a InsertAllRequest object given the destination table and the rows to insert.

Parameters
Name Description
datasetId String
tableId String
rows RowToInsert[]
Returns
Type Description
InsertAllRequest

of(String datasetId, String tableId, Iterable<InsertAllRequest.RowToInsert> rows)

publicstaticInsertAllRequestof(StringdatasetId,StringtableId,Iterable<InsertAllRequest.RowToInsert>rows)

Returns a InsertAllRequest object given the destination table and the rows to insert.

Parameters
Name Description
datasetId String
tableId String
rows Iterable<RowToInsert>
Returns
Type Description
InsertAllRequest

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getRows()

publicList<InsertAllRequest.RowToInsert>getRows()

Returns the rows to be inserted.

Returns
Type Description
List<RowToInsert>

getTable()

publicTableIdgetTable()

Returns the destination table for rows insert request.

Returns
Type Description
TableId

getTemplateSuffix()

publicStringgetTemplateSuffix()

If specified, the destination table is treated as a base template. Rows are inserted into an instance table named "{destination}{templateSuffix}". BigQuery will manage the creation of the instance table, using the schema of the base template table. Table creation might take some time. To obtain table's information after BigQuery#insertAll(InsertAllRequest) is called use:


StringsuffixTableId=...;
TableInfosuffixTable=bigquery.getTable(DATASET,suffixTableId);
while(suffixTable==null){
Thread.sleep(1000L);
suffixTable=bigquery.getTable(DATASET,suffixTableId);
}

See Also: Template Tables

Returns
Type Description
String

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

ignoreUnknownValues()

publicBooleanignoreUnknownValues()

Returns 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.

Returns
Type Description
Boolean

skipInvalidRows()

publicBooleanskipInvalidRows()

Returns whether to insert all valid rows of a request, even if invalid rows exist. If not set the entire insert request will fail if it contains an invalid row.

Returns
Type Description
Boolean

toString()

publicStringtoString()
Returns
Type Description
String
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.