tabledata
Creates, updates, deletes, gets or lists a tabledata
resource.
Overview
Name | tabledata |
Type | Resource |
Id | google.bigquery.tabledata |
Fields
The following fields are returned by SELECT
queries:
- list
Successful response
Name | Datatype | Description |
---|---|---|
etag | string | A hash of this page of results. |
kind | string | The resource type of the response. (default: bigquery#tableDataList) |
pageToken | string | A token used for paging results. Providing this token instead of the startIndex parameter can help you retrieve stable results when an underlying table is changing. |
rows | array | Rows of results. |
totalRows | string (int64) | Total rows of the entire table. In order to show default value 0 we have to present it as string. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list | select | projectId , +datasetId , +tableId | formatOptions.timestampOutputFormat , formatOptions.useInt64Timestamp , maxResults , pageToken , selectedFields , startIndex | List the content of a table in rows. |
insert_all | insert | projectId , +datasetId , +tableId | Streams data into BigQuery one record at a time without needing to run a load job. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
+datasetId | string | |
+tableId | string | |
projectId | string | |
formatOptions.timestampOutputFormat | string | |
formatOptions.useInt64Timestamp | boolean | |
maxResults | integer (uint32) | |
pageToken | string | |
selectedFields | string | |
startIndex | string (uint64) |
SELECT
examples
- list
List the content of a table in rows.
SELECT
etag,
kind,
pageToken,
rows,
totalRows
FROM google.bigquery.tabledata
WHERE projectId = '{{ projectId }}' -- required
AND +datasetId = '{{ +datasetId }}' -- required
AND +tableId = '{{ +tableId }}' -- required
AND formatOptions.timestampOutputFormat = '{{ formatOptions.timestampOutputFormat }}'
AND formatOptions.useInt64Timestamp = '{{ formatOptions.useInt64Timestamp }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND selectedFields = '{{ selectedFields }}'
AND startIndex = '{{ startIndex }}';
INSERT
examples
- insert_all
- Manifest
Streams data into BigQuery one record at a time without needing to run a load job.
INSERT INTO google.bigquery.tabledata (
data__ignoreUnknownValues,
data__kind,
data__rows,
data__skipInvalidRows,
data__templateSuffix,
data__traceId,
projectId,
+datasetId,
+tableId
)
SELECT
{{ ignoreUnknownValues }},
'{{ kind }}',
'{{ rows }}',
{{ skipInvalidRows }},
'{{ templateSuffix }}',
'{{ traceId }}',
'{{ projectId }}',
'{{ +datasetId }}',
'{{ +tableId }}'
RETURNING
insertErrors,
kind
;
# Description fields are for documentation purposes
- name: tabledata
props:
- name: projectId
value: string
description: Required parameter for the tabledata resource.
- name: +datasetId
value: string
description: Required parameter for the tabledata resource.
- name: +tableId
value: string
description: Required parameter for the tabledata resource.
- name: ignoreUnknownValues
value: boolean
description: >
Optional. Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false, which treats unknown values as errors.
- name: kind
value: string
description: >
Optional. The resource type of the response. The value is not checked at the backend. Historically, it has been set to "bigquery#tableDataInsertAllRequest" but you are not required to set it.
default: bigquery#tableDataInsertAllRequest
- name: rows
value: array
- name: skipInvalidRows
value: boolean
description: >
Optional. Insert all valid rows of a request, even if invalid rows exist. The default value is false, which causes the entire request to fail if any invalid rows exist.
- name: templateSuffix
value: string
description: >
Optional. If 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 https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables for considerations when working with templates tables.
- name: traceId
value: string
description: >
Optional. Unique request trace id. Used for debugging purposes only. It is case-sensitive, limited to up to 36 ASCII characters. A UUID is recommended.