tables

PUT /projects/{projectsId}/datasets/{datasetsId}/tables/{tablesId}

Changed on

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. # IAM Permissions Requires the bigquery.tables.update permission on the table.

Request

  • Base URL
    https://bigquery.googleapis.com/bigquery/v2
  • Auth
    • OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/bigquery
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/bigquery
    • or OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/cloud-platform
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/cloud-platform

Path parameters

projectsIdstring required
datasetsIdstring required
tablesIdstring required

Query parameters

autodetect_schemaboolean

Optional. When true will autodetect schema, else will keep original schema

Request body

creationTimestring int64

Output only. The time when this table was created, in milliseconds since the epoch.

defaultCollationstring

Optional. Defines the default collation specification of new STRING fields in the table. During table creation or update, if a STRING field is added to this table without explicit collation specified, then the table inherits the table default collation. A change to this field affects only fields added afterwards, and does not alter the existing fields. The following values are supported: * 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to case-sensitive behavior.

defaultRoundingMode'ROUNDING_MODE_UNSPECIFIED' | 'ROUND_HALF_AWAY_FROM_ZERO' | 'ROUND_HALF_EVEN'

Optional. Defines the default rounding mode specification of new decimal fields (NUMERIC OR BIGNUMERIC) in the table. During table creation or update, if a decimal field is added to this table without an explicit rounding mode specified, then the field inherits the table default rounding mode. Changing this field doesn't affect existing fields.

descriptionstring

Optional. A user-friendly description of this table.

etagstring

Output only. A hash of this resource.

expirationTimestring int64

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. The defaultTableExpirationMs property of the encapsulating dataset can be used to set a default expirationTime on newly created tables.

friendlyNamestring

Optional. A descriptive name for this table.

idstring

Output only. An opaque ID uniquely identifying the table.

kindstring

The type of resource ID.

labelsobject

The labels associated with this table. You can use these to organize and group your tables. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key.

lastModifiedTimestring uint64

Output only. The time when this table was last modified, in milliseconds since the epoch.

locationstring

Output only. The geographic location where the table resides. This value is inherited from the dataset.

managedTableType'MANAGED_TABLE_TYPE_UNSPECIFIED' | 'NATIVE' | 'BIGLAKE'

Optional. If set, overrides the default managed table type configured in the dataset.

maxStalenessstring

Optional. The maximum staleness of data that could be returned when the table (or stale MV) is queried. Staleness encoded as a string encoding of sql IntervalValue type.

numActiveLogicalBytesstring int64

Output only. Number of logical bytes that are less than 90 days old.

numActivePhysicalBytesstring int64

Output only. Number of physical bytes less than 90 days old. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.

numBytesstring int64

Output only. The size of this table in logical bytes, excluding any data in the streaming buffer.

numCurrentPhysicalBytesstring int64

Output only. Number of physical bytes used by current live data storage. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.

numLongTermBytesstring int64

Output only. The number of logical bytes in the table that are considered "long-term storage".

numLongTermLogicalBytesstring int64

Output only. Number of logical bytes that are more than 90 days old.

numLongTermPhysicalBytesstring int64

Output only. Number of physical bytes more than 90 days old. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.

numPartitionsstring int64

Output only. The number of partitions present in the table or materialized view. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.

numPhysicalBytesstring int64

Output only. The physical size of this table in bytes. This includes storage used for time travel.

numRowsstring uint64

Output only. The number of rows of data in this table, excluding any data in the streaming buffer.

numTimeTravelPhysicalBytesstring int64

Output only. Number of physical bytes used by time travel storage (deleted or changed data). This data is not kept in real time, and might be delayed by a few seconds to a few minutes.

numTotalLogicalBytesstring int64

Output only. Total number of logical bytes in the table or materialized view.

numTotalPhysicalBytesstring int64

Output only. The physical size of this table in bytes. This also includes storage used for time travel. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.

requirePartitionFilterboolean

Optional. If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified.

resourceTagsobject

[Optional] The tags associated with this table. Tag keys are globally unique. See additional information on tags. An object containing a list of "key": value pairs. The key is the namespaced friendly name of the tag key, e.g. "12345/environment" where 12345 is parent id. The value is the friendly short name of the tag value, e.g. "production".

selfLinkstring

Output only. A URL that can be used to access this resource again.

typestring

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. * EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. * MATERIALIZED_VIEW: A precomputed view defined by a SQL query. * SNAPSHOT: An immutable BigQuery table that preserves the contents of a base table at a particular time. See additional information on table snapshots. The default value is TABLE.

Response

Successful response

creationTimestring int64

Output only. The time when this table was created, in milliseconds since the epoch.

defaultCollationstring

Optional. Defines the default collation specification of new STRING fields in the table. During table creation or update, if a STRING field is added to this table without explicit collation specified, then the table inherits the table default collation. A change to this field affects only fields added afterwards, and does not alter the existing fields. The following values are supported: * 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to case-sensitive behavior.

defaultRoundingMode'ROUNDING_MODE_UNSPECIFIED' | 'ROUND_HALF_AWAY_FROM_ZERO' | 'ROUND_HALF_EVEN'

Optional. Defines the default rounding mode specification of new decimal fields (NUMERIC OR BIGNUMERIC) in the table. During table creation or update, if a decimal field is added to this table without an explicit rounding mode specified, then the field inherits the table default rounding mode. Changing this field doesn't affect existing fields.

descriptionstring

Optional. A user-friendly description of this table.

etagstring

Output only. A hash of this resource.

expirationTimestring int64

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. The defaultTableExpirationMs property of the encapsulating dataset can be used to set a default expirationTime on newly created tables.

friendlyNamestring

Optional. A descriptive name for this table.

idstring

Output only. An opaque ID uniquely identifying the table.

kindstring

The type of resource ID.

labelsobject

The labels associated with this table. You can use these to organize and group your tables. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key.

lastModifiedTimestring uint64

Output only. The time when this table was last modified, in milliseconds since the epoch.

locationstring

Output only. The geographic location where the table resides. This value is inherited from the dataset.

managedTableType'MANAGED_TABLE_TYPE_UNSPECIFIED' | 'NATIVE' | 'BIGLAKE'

Optional. If set, overrides the default managed table type configured in the dataset.

maxStalenessstring

Optional. The maximum staleness of data that could be returned when the table (or stale MV) is queried. Staleness encoded as a string encoding of sql IntervalValue type.

numActiveLogicalBytesstring int64

Output only. Number of logical bytes that are less than 90 days old.

numActivePhysicalBytesstring int64

Output only. Number of physical bytes less than 90 days old. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.

numBytesstring int64

Output only. The size of this table in logical bytes, excluding any data in the streaming buffer.

numCurrentPhysicalBytesstring int64

Output only. Number of physical bytes used by current live data storage. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.

numLongTermBytesstring int64

Output only. The number of logical bytes in the table that are considered "long-term storage".

numLongTermLogicalBytesstring int64

Output only. Number of logical bytes that are more than 90 days old.

numLongTermPhysicalBytesstring int64

Output only. Number of physical bytes more than 90 days old. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.

numPartitionsstring int64

Output only. The number of partitions present in the table or materialized view. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.

numPhysicalBytesstring int64

Output only. The physical size of this table in bytes. This includes storage used for time travel.

numRowsstring uint64

Output only. The number of rows of data in this table, excluding any data in the streaming buffer.

numTimeTravelPhysicalBytesstring int64

Output only. Number of physical bytes used by time travel storage (deleted or changed data). This data is not kept in real time, and might be delayed by a few seconds to a few minutes.

numTotalLogicalBytesstring int64

Output only. Total number of logical bytes in the table or materialized view.

numTotalPhysicalBytesstring int64

Output only. The physical size of this table in bytes. This also includes storage used for time travel. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.

requirePartitionFilterboolean

Optional. If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified.

resourceTagsobject

[Optional] The tags associated with this table. Tag keys are globally unique. See additional information on tags. An object containing a list of "key": value pairs. The key is the namespaced friendly name of the tag key, e.g. "12345/environment" where 12345 is parent id. The value is the friendly short name of the tag value, e.g. "production".

selfLinkstring

Output only. A URL that can be used to access this resource again.

typestring

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. * EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. * MATERIALIZED_VIEW: A precomputed view defined by a SQL query. * SNAPSHOT: An immutable BigQuery table that preserves the contents of a base table at a particular time. See additional information on table snapshots. The default value is TABLE.

Changes

    • info

      the security scope https://www.googleapis.com/auth/bigquery was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/bigquery was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was removed from the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/bigquery was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/bigquery was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was removed from the endpoint's security scheme Oauth2c