Skip to main content

tables

Overview

Nametables
TypeResource
Idgoogle.bigquery.tables

Fields

NameDatatypeDescription
idstring[Output-only] An opaque ID uniquely identifying the table.
descriptionstring[Optional] A user-friendly description of this table.
modelobject
numTotalPhysicalBytesstring[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.
etagstring[Output-only] A hash of the table metadata. Used to ensure there were no concurrent modifications to the resource when attempting an update. Not guaranteed to change when the table contents or the fields numRows, numBytes, numLongTermBytes or lastModifiedTime change.
lastModifiedTimestring[Output-only] The time when this table was last modified, in milliseconds since the epoch.
numRowsstring[Output-only] The number of rows of data in this table, excluding any data in the streaming buffer.
defaultRoundingModestring[Output-only] The default rounding mode of the table.
numPhysicalBytesstring[Output-only][TrustedTester] The physical size of this table in bytes, excluding any data in the streaming buffer. This includes compression and storage used for time travel.
numPartitionsstring[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.
numActivePhysicalBytesstring[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.
clusteringobject
expirationTimestring[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.
materializedViewobject
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. SNAPSHOT: An immutable, read-only table that is a copy of another table. [TrustedTester] MATERIALIZED_VIEW: SQL query whose result is persisted. EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. The default value is TABLE.
viewobject
tableReferenceobject
selfLinkstring[Output-only] A URL that can be used to access this resource again.
rangePartitioningobject
locationstring[Output-only] The geographic location where the table resides. This value is inherited from the dataset.
tableConstraintsobject
numLongTermBytesstring[Output-only] The number of bytes in the table that are considered "long-term storage".
biglakeConfigurationobject
creationTimestring[Output-only] The time when this table was created, in milliseconds since the epoch.
numTotalLogicalBytesstring[Output-only] Total number of logical bytes in the table or materialized view.
cloneDefinitionobject
externalDataConfigurationobject
encryptionConfigurationobject
snapshotDefinitionobject
numLongTermPhysicalBytesstring[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.
timePartitioningobject
kindstring[Output-only] The type of the resource.
defaultCollationstring[Output-only] The default collation of the table.
numLongTermLogicalBytesstring[Output-only] Number of logical bytes that are more than 90 days old.
requirePartitionFilterboolean[Optional] If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified.
schemaobject
numActiveLogicalBytesstring[Output-only] Number of logical bytes that are less than 90 days old.
labelsobjectThe 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.
friendlyNamestring[Optional] A descriptive name for this table.
maxStalenessstring[Optional] Max staleness of data that could be returned when table or materialized view is queried (formatted as Google SQL Interval type).
streamingBufferobject
numBytesstring[Output-only] The size of this table in bytes, excluding any data in the streaming buffer.
numTimeTravelPhysicalBytesstring[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.

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatasetId, projectId, tableIdGets 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.
listSELECTdatasetId, projectIdLists all tables in the specified dataset. Requires the READER dataset role.
insertINSERTdatasetId, projectIdCreates a new, empty table in the dataset.
deleteDELETEdatasetId, projectId, tableIdDeletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.
_listEXECdatasetId, projectIdLists all tables in the specified dataset. Requires the READER dataset role.
patchEXECdatasetId, projectId, tableIdUpdates 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.
updateEXECdatasetId, projectId, tableIdUpdates 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.