public class Table extends TableInfo
Objects of this class are immutable. Operations that modify the table like update(com.google.cloud.bigquery.BigQuery.TableOption...)
return a new object. To get a Table object with the most recent information use
reload(com.google.cloud.bigquery.BigQuery.TableOption...). Table adds a layer of service-related functionality over
TableInfo.
| Modifier and Type | Class and Description |
|---|---|
static class |
Table.Builder
A builder for
Table objects. |
| Modifier and Type | Method and Description |
|---|---|
BigQuery |
bigquery()
Returns the table's
BigQuery object used to issue requests. |
Job |
copy(String destinationDataset,
String destinationTable,
BigQuery.JobOption... options)
Starts a BigQuery Job to copy the current table to the provided destination table.
|
Job |
copy(TableId destinationTable,
BigQuery.JobOption... options)
Starts a BigQuery Job to copy the current table to the provided destination table.
|
boolean |
delete()
Deletes this table.
|
boolean |
equals(Object obj) |
boolean |
exists()
Checks if this table exists.
|
Job |
extract(String format,
List<String> destinationUris,
BigQuery.JobOption... options)
Starts a BigQuery Job to extract the current table to the provided destination URIs.
|
Job |
extract(String format,
String destinationUri,
BigQuery.JobOption... options)
Starts a BigQuery Job to extract the current table to the provided destination URI.
|
int |
hashCode() |
InsertAllResponse |
insert(Iterable<InsertAllRequest.RowToInsert> rows)
Insert rows into the table.
|
InsertAllResponse |
insert(Iterable<InsertAllRequest.RowToInsert> rows,
boolean skipInvalidRows,
boolean ignoreUnknownValues)
Insert rows into the table.
|
Page<List<FieldValue>> |
list(BigQuery.TableDataListOption... options)
Returns the paginated list rows in this table.
|
Job |
load(FormatOptions format,
List<String> sourceUris,
BigQuery.JobOption... options)
Starts a BigQuery Job to load data into the current table from the provided source URIs.
|
Job |
load(FormatOptions format,
String sourceUri,
BigQuery.JobOption... options)
Starts a BigQuery Job to load data into the current table from the provided source URI.
|
Table |
reload(BigQuery.TableOption... options)
Fetches current table's latest information.
|
Table.Builder |
toBuilder()
Returns a builder for the table object.
|
Table |
update(BigQuery.TableOption... options)
Updates the table's information with this table's information.
|
builder, creationTime, definition, description, etag, expirationTime, friendlyName, generatedId, lastModifiedTime, of, selfLink, tableId, toStringpublic boolean exists()
true if this table exists, false otherwiseBigQueryException - upon failurepublic Table reload(BigQuery.TableOption... options)
null if the table does not exist.options - table optionsTable object with latest information or null if not foundBigQueryException - upon failurepublic Table update(BigQuery.TableOption... options)
Table object is returned.options - dataset optionsTable object with updated informationBigQueryException - upon failurepublic boolean delete()
true if table was deleted, false if it was not foundBigQueryException - upon failurepublic InsertAllResponse insert(Iterable<InsertAllRequest.RowToInsert> rows) throws BigQueryException
rows - rows to be insertedBigQueryException - upon failurepublic InsertAllResponse insert(Iterable<InsertAllRequest.RowToInsert> rows, boolean skipInvalidRows, boolean ignoreUnknownValues) throws BigQueryException
rows - rows to be insertedskipInvalidRows - 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 rowignoreUnknownValues - 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 invalidBigQueryException - upon failurepublic Page<List<FieldValue>> list(BigQuery.TableDataListOption... options) throws BigQueryException
options - table data list optionsBigQueryException - upon failurepublic Job copy(String destinationDataset, String destinationTable, BigQuery.JobOption... options) throws BigQueryException
Job object.destinationDataset - the user-defined id of the destination datasetdestinationTable - the user-defined id of the destination tableoptions - job optionsBigQueryException - upon failurepublic Job copy(TableId destinationTable, BigQuery.JobOption... options) throws BigQueryException
Job object.destinationTable - the destination table of the copy joboptions - job optionsBigQueryException - upon failurepublic Job extract(String format, String destinationUri, BigQuery.JobOption... options) throws BigQueryException
Job object.format - the format of the extracted datadestinationUri - the fully-qualified Google Cloud Storage URI (e.g. gs://bucket/path)
where the extracted table should be writtenoptions - job optionsBigQueryException - upon failurepublic Job extract(String format, List<String> destinationUris, BigQuery.JobOption... options) throws BigQueryException
Job object.format - the format of the exported datadestinationUris - the fully-qualified Google Cloud Storage URIs (e.g. gs://bucket/path)
where the extracted table should be writtenoptions - job optionsBigQueryException - upon failurepublic Job load(FormatOptions format, String sourceUri, BigQuery.JobOption... options) throws BigQueryException
Job object.format - the format of the data to loadsourceUri - the fully-qualified Google Cloud Storage URI (e.g. gs://bucket/path) from
which to load the dataoptions - job optionsBigQueryException - upon failurepublic Job load(FormatOptions format, List<String> sourceUris, BigQuery.JobOption... options) throws BigQueryException
Job object.format - the format of the exported datasourceUris - the fully-qualified Google Cloud Storage URIs (e.g. gs://bucket/path) from
which to load the dataoptions - job optionsBigQueryException - upon failurepublic BigQuery bigquery()
BigQuery object used to issue requests.public Table.Builder toBuilder()
TableInfoCopyright © 2016 Google. All rights reserved.