Skip to main content

datasets

Overview

Namedatasets
TypeResource
Idgoogle.bigquery.datasets

Fields

NameDatatypeDescription
idstring[Output-only] The fully-qualified unique name of the dataset in the format projectId:datasetId. The dataset name without the project name is given in the datasetId field. When creating a new dataset, leave this field blank, and instead specify the datasetId field.
descriptionstring[Optional] A user-friendly description of the dataset.
defaultPartitionExpirationMsstring[Optional] The default partition expiration for all partitioned tables in the dataset, in milliseconds. Once this property is set, all newly-created partitioned tables in the dataset will have an expirationMs property in the timePartitioning settings set to this value, and changing the value will only affect new tables, not existing ones. The storage in a partition will have an expiration time of its partition time plus this value. Setting this property overrides the use of defaultTableExpirationMs for partitioned tables: only one of defaultTableExpirationMs and defaultPartitionExpirationMs will be used for any new partitioned table. If you provide an explicit timePartitioning.expirationMs when creating or updating a partitioned table, that value takes precedence over the default partition expiration time indicated by this property.
friendlyNamestring[Optional] A descriptive name for the dataset.
externalDatasetReferenceobject
kindstring[Output-only] The resource type.
tagsarray[Optional]The tags associated with this dataset. Tag keys are globally unique.
labelsobjectThe labels associated with this dataset. You can use these to organize and group your datasets. You can set this property when inserting or updating a dataset. See Creating and Updating Dataset Labels for more information.
lastModifiedTimestring[Output-only] The date when this dataset or any of its tables was last modified, in milliseconds since the epoch.
defaultRoundingModestring[Output-only] The default rounding mode of the dataset.
satisfiesPzsboolean[Output-only] Reserved for future use.
accessarray[Optional] An array of objects that define dataset access for one or more entities. You can set this property when inserting or updating a dataset in order to control who is allowed to access the data. If unspecified at dataset creation time, BigQuery adds default dataset access for the following entities: access.specialGroup: projectReaders; access.role: READER; access.specialGroup: projectWriters; access.role: WRITER; access.specialGroup: projectOwners; access.role: OWNER; access.userByEmail: [dataset creator email]; access.role: OWNER;
selfLinkstring[Output-only] A URL that can be used to access the resource again. You can use this URL in Get or Update requests to the resource.
creationTimestring[Output-only] The time when this dataset was created, in milliseconds since the epoch.
datasetReferenceobject
etagstring[Output-only] A hash of the resource.
isCaseInsensitiveboolean[Optional] Indicates if table names are case insensitive in the dataset.
locationstringThe geographic location where the dataset should reside. The default value is US. See details at https://cloud.google.com/bigquery/docs/locations.
storageBillingModelstring[Optional] Storage billing model to be used for all tables in the dataset. Can be set to PHYSICAL. Default is LOGICAL.
defaultTableExpirationMsstring[Optional] The default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour). Once this property is set, all newly-created tables in the dataset will have an expirationTime property set to the creation time plus the value in this property, and changing the value will only affect new tables, not existing ones. When the expirationTime for a given table is reached, that table will be deleted automatically. If a table's expirationTime is modified or removed before the table expires, or if you provide an explicit expirationTime when creating a table, that value takes precedence over the default expiration time indicated by this property.
maxTimeTravelHoursstring[Optional] Number of hours for the max time travel for all tables in the dataset.
defaultCollationstring[Output-only] The default collation of the dataset.
defaultEncryptionConfigurationobject

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatasetId, projectIdReturns the dataset specified by datasetID.
listSELECTprojectIdLists all datasets in the specified project to which you have been granted the READER dataset role.
insertINSERTprojectIdCreates a new empty dataset.
deleteDELETEdatasetId, projectIdDeletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.
_listEXECprojectIdLists all datasets in the specified project to which you have been granted the READER dataset role.
patchEXECdatasetId, projectIdUpdates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics.
updateEXECdatasetId, projectIdUpdates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource.