Reference documentation and code samples for the BigQuery Client class Table.
Tables are a standard two-dimensional table with individual records organized in rows, and a data type assigned to each column (also called a field).
Namespace
Google \ Cloud \ BigQueryMethods
__construct
| Parameters | |
|---|---|
| Name | Description | 
| connection | Connection\ConnectionInterfaceRepresents a connection to BigQuery. This object is created by BigQueryClient, and should not be instantiated outside of this client. | 
| id | stringThe table's id. | 
| datasetId | stringThe dataset's id. | 
| projectId | stringThe project's id. | 
| mapper | ValueMapperMaps values between PHP and BigQuery. | 
| info | array[optional] The table's metadata. | 
| location | string|null[optional] A default geographic location, used when no table metadata exists. | 
exists
Check whether or not the table exists.
Example:
if ($table->exists()) { echo 'Table exists!'; } | Returns | |
|---|---|
| Type | Description | 
| bool | |
delete
See also:
| Parameter | |
|---|---|
| Name | Description | 
| options | array[optional] Configuration options. | 
update
| Parameters | |
|---|---|
| Name | Description | 
| metadata | arrayThe available options for metadata are outlined at the Table Resource API docs | 
| options | array[optional] Configuration options. | 
rows
See also:
| Parameters | |
|---|---|
| Name | Description | 
| options | arrayConfiguration options. | 
| ↳ maxResults | intMaximum number of results to return per page. | 
| ↳ resultLimit | intLimit the number of results returned in total. Defaults to  | 
| ↳ pageToken | stringA previously-returned page token used to resume the loading of results from a specific point. | 
| ↳ startIndex | intZero-based index of the starting row. | 
| ↳ formatOptions.useInt64Timestamp | booleanOptional. Output timestamp as usec int64. Default is true. | 
| Returns | |
|---|---|
| Type | Description | 
| Google\Cloud\Core\Iterator\ItemIterator<array> | |
runJob
See also:
| Parameters | |
|---|---|
| Name | Description | 
| config | JobConfigurationInterfaceThe job configuration. | 
| options | arrayConfiguration options. | 
| ↳ maxRetries | intThe number of times to retry, checking if the job has completed. Defaults to  | 
| Returns | |
|---|---|
| Type | Description | 
| Job | |
startJob
See also:
| Parameters | |
|---|---|
| Name | Description | 
| config | JobConfigurationInterfaceThe job configuration. | 
| options | array[optional] Configuration options. | 
| Returns | |
|---|---|
| Type | Description | 
| Job | |
copy
See also:
| Parameters | |||||||
|---|---|---|---|---|---|---|---|
| Name | Description | ||||||
| destination | TableThe destination table. | ||||||
| options | arrayConfiguration options. | ||||||
| ↳ configuration | arrayJob configuration. Please see the API documentation for the available options. 
 | ||||||
| Returns | |
|---|---|
| Type | Description | 
| CopyJobConfiguration | |
extract
See also:
| Parameters | |||||||
|---|---|---|---|---|---|---|---|
| Name | Description | ||||||
| destination | string|Google\Cloud\Storage\StorageObjectThe destination object. May be a Google\Cloud\Storage\StorageObject or a URI pointing to a Google Cloud Storage object in the format of  | ||||||
| options | arrayConfiguration options. | ||||||
| ↳ configuration | arrayJob configuration. Please see the API documentation for the available options. 
 | ||||||
| Returns | |
|---|---|
| Type | Description | 
| ExtractJobConfiguration | |
load
See also:
| Parameters | |||||||
|---|---|---|---|---|---|---|---|
| Name | Description | ||||||
| data | string|resource|Psr\Http\Message\StreamInterfaceThe data to load. | ||||||
| options | arrayConfiguration options. | ||||||
| ↳ configuration | arrayJob configuration. Please see the API documentation for the available options. 
 | ||||||
| Returns | |
|---|---|
| Type | Description | 
| LoadJobConfiguration | |
loadFromStorage
See also:
| Parameters | |||||||
|---|---|---|---|---|---|---|---|
| Name | Description | ||||||
| object | string|Google\Cloud\Storage\StorageObjectThe object to load data from. May be a Google\Cloud\Storage\StorageObject or a URI pointing to a Google Cloud Storage object in the format of  | ||||||
| options | arrayConfiguration options. | ||||||
| ↳ configuration | arrayJob configuration. Please see the API documentation for the available options. 
 | ||||||
| Returns | |
|---|---|
| Type | Description | 
| LoadJobConfiguration | |
insertRow
| Parameters | |
|---|---|
| Name | Description | 
| row | arrayKey/value set of data matching the table's schema. | 
| options | arrayPlease see Table::insertRows() for the other available configuration options. | 
| ↳ insertId | stringUsed to ensure data consistency. | 
| Returns | |
|---|---|
| Type | Description | 
| InsertResponse | |
insertRows
| Parameters | |
|---|---|
| Name | Description | 
| rows | arrayThe rows to insert. Each item in the array must contain a  | 
| options | arrayConfiguration options. | 
| ↳ autoCreate | boolWhether or not to attempt to automatically create the table in the case it does not exist. Please note, it will be required to provide a schema through $tableMetadata['schema'] in the case the table does not already exist. Defaults to  | 
| ↳ tableMetadata | arrayMetadata to apply to table to be created. The full set of metadata are outlined at the Table Resource API docs. Only applies when  | 
| ↳ maxRetries | intThe maximum number of times to attempt creating the table in the case of failure. Please note, each retry attempt may take up to two minutes. Only applies when  | 
| ↳ skipInvalidRows | boolInsert all valid rows of a request, even if invalid rows exist. The default value is  | 
| ↳ ignoreUnknownValues | boolAccept rows that contain values that do not match the schema. The unknown values are ignored. The default value is  | 
| ↳ templateSuffix | stringIf specified, treats the destination table as a base template, and inserts the rows into an instance table named "{destination}{templateSuffix}". BigQuery will manage creation of the instance table, using the schema of the base template table. See Creating tables automatically using template tables for considerations when working with templates tables. | 
| Returns | |
|---|---|
| Type | Description | 
| InsertResponse | |
info
See also:
| Parameter | |
|---|---|
| Name | Description | 
| options | array[optional] Configuration options. | 
| Returns | |
|---|---|
| Type | Description | 
| array | |
reload
See also:
| Parameter | |
|---|---|
| Name | Description | 
| options | array[optional] Configuration options. | 
| Returns | |
|---|---|
| Type | Description | 
| array | |
id
Retrieves the table's ID.
Example:
echo $table->id(); | Returns | |
|---|---|
| Type | Description | 
| string | |
identity
Retrieves the table's identity.
An identity provides a description of a nested resource.
Example:
echo $table->identity()['projectId']; | Returns | |
|---|---|
| Type | Description | 
| array | |
iam
See also:
| Returns | |
|---|---|
| Type | Description | 
| Google\Cloud\Core\Iam\Iam | |
Constants
MAX_RETRIES
Value: 100INSERT_CREATE_MAX_DELAY_MICROSECONDS
Value: 60000000