Hide
Google BigQuery

Tables

A table is a part of a dataset. For more information, see Tables.

For a list of methods for this resource, see the end of this page.

Resource representations

{
  "kind": "bigquery#table",
  "etag": etag,
  "id": string,
  "selfLink": string,
  "tableReference": {
    "projectId": string,
    "datasetId": string,
    "tableId": string
  },
  "friendlyName": string,
  "description": string,
  "schema": {
    "fields": [
      {
        "name": string,
        "type": string,
        "mode": string,
        "fields": [
          (TableFieldSchema)
        ],
        "description": string
      }
    ]
  },
  "numBytes": long,
  "numRows": unsigned long,
  "creationTime": long,
  "expirationTime": long,
  "lastModifiedTime": long,
  "type": string,
  "view": {
    "query": string
  }
}
Property name Value Description Notes
creationTime long [Output-only] The time when this table was created, in milliseconds since the epoch.
description string [Optional] A user-friendly description of this table. writable
etag etag [Output-only] A hash of this resource.
expirationTime long [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
friendlyName string [Optional] A descriptive name for this table. writable
id string [Output-only] An opaque ID uniquely identifying the table.
kind bigquery#table The type of resource ID.
lastModifiedTime long [Output-only] The time when this table was last modified, in milliseconds since the epoch.
numBytes long [Output-only] The size of the table in bytes. This property is unavailable for tables that are actively receiving streaming inserts.
numRows unsigned long [Output-only] The number of rows of data in this table. This property is unavailable for tables that are actively receiving streaming inserts.
schema nested object [Optional] Describes the schema of this table. writable
schema.fields[] list Describes the fields in a table.
schema.fields[].description string [Optional] The field description. The maximum length is 16K characters.
schema.fields[].fields[] list [Optional] Describes the nested schema fields if the type property is set to RECORD.
schema.fields[].mode string [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
schema.fields[].name string [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters.
schema.fields[].type string [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema). For more information about allowed values for each type, see data types.
tableReference nested object [Required] Reference describing the ID of this table.
tableReference.datasetId string [Required] The ID of the dataset containing this table.
tableReference.projectId string [Required] The ID of the project containing this table.
tableReference.tableId string [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
type string [Output-only] Describes the table type. The following values are supported:

  • TABLE: A normal BigQuery table. 
  • VIEW: A virtual table defined by a SQL query. For more information, see views.
The default value is TABLE.
view nested object [Optional] The view definition. writable
view.query string [Required] A query that BigQuery executes when the view is referenced.

Methods

The following methods are supported:

delete
Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.
get
Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.
insert
Creates a new, empty table in the dataset.
list
Lists all tables in the specified dataset.
patch
Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.
update
Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.