Package com.google.cloud.bigquery
Class DatasetInfo
java.lang.Object
com.google.cloud.bigquery.DatasetInfo
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Dataset
Google BigQuery Dataset information. A dataset is a grouping mechanism that holds zero or more
tables. Datasets are the lowest level unit of access control; you cannot control access at the
table level.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder forDatasetInfoobjects. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetAcl()Returns the dataset's access control configuration.Returns the time when this dataset was created, in milliseconds since the epoch.Returns the dataset identity.Returns the default lifetime of all tables in the dataset, in milliseconds.Returns a user-friendly description for the dataset.getEtag()Returns the hash of the dataset resource.Returns information about the external metadata storage where the dataset is defined.Returns a user-friendly name for the dataset.Returns the service-generated id for the dataset.Return a map for labels applied to the dataset.Returns the time when this dataset or any of its tables was last modified, in milliseconds since the epoch.Returns the geographic location where the dataset should reside.Returns the number of hours that deleted or updated data will be available to be queried for all tables in the dataset.protected io.opentelemetry.api.common.AttributesOptional.Returns an URL that can be used to access the resource again.inthashCode()static DatasetInfo.BuildernewBuilder(DatasetId datasetId) Returns a builder for aDatasetInfoobject given it's identity.static DatasetInfo.BuildernewBuilder(String datasetId) Returns a builder for aDatasetInfoobject given it's user-defined id.static DatasetInfo.BuildernewBuilder(String projectId, String datasetId) Returns a builder for the DatasetInfo object given it's user-defined project and dataset ids.static DatasetInfoReturns aDatasetInfoobject given it's identity.static DatasetInfoReturns aDatasetInfoobject given it's user-defined id.Returns a builder for the dataset object.toString()
-
Method Details
-
getDatasetId
Returns the dataset identity. -
getAcl
Returns the dataset's access control configuration.Update the ACLs for a dataset.
Dataset dataset = bigquery.getDataset(DatasetId.of("my_dataset")); List<Acl> beforeAcls = dataset.getAcl(); // Make a copy of the ACLs so that they can be modified. ArrayList<Acl> acls = new ArrayList<>(beforeAcls); acls.add(Acl.of(new Acl.User("sample.bigquery.dev@gmail.com"), Acl.Role.READER)); Dataset.Builder builder = dataset.toBuilder(); builder.setAcl(acls); bigquery.update(builder.build()); // API request.- See Also:
-
getCreationTime
Returns the time when this dataset was created, in milliseconds since the epoch. -
getDefaultTableLifetime
Returns the default lifetime of all tables in the dataset, in milliseconds. 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.Update the default table expiration time for a dataset.
Dataset dataset = bigquery.getDataset(DatasetId.of("my_dataset")); Long beforeExpiration = dataset.getDefaultTableLifetime(); Long oneDayMilliseconds = 24 * 60 * 60 * 1000L; Dataset.Builder builder = dataset.toBuilder(); builder.setDefaultTableLifetime(oneDayMilliseconds); bigquery.update(builder.build()); // API request. -
getDescription
Returns a user-friendly description for the dataset. -
getEtag
Returns the hash of the dataset resource. -
getFriendlyName
Returns a user-friendly name for the dataset. -
getGeneratedId
Returns the service-generated id for the dataset. -
getLastModified
Returns the time when this dataset or any of its tables was last modified, in milliseconds since the epoch. -
getLocation
Returns the geographic location where the dataset should reside.- See Also:
-
getSelfLink
Returns an URL that can be used to access the resource again. The returned URL can be used for get or update requests. -
getLabels
Return a map for labels applied to the dataset.- See Also:
-
getDefaultEncryptionConfiguration
-
getDefaultPartitionExpirationMs
-
getDefaultCollation
-
getStorageBillingModel
-
getMaxTimeTravelHours
Returns the number of hours that deleted or updated data will be available to be queried for all tables in the dataset. -
getResourceTags
Optional. The tags attached to this dataset. Tag keys are globally unique. Tag key is expected to be in the namespaced format, for example "123456789012/environment" where 123456789012 is the ID of the parent organization or project resource for this tag key. Tag value is expected to be the short name, for example "Production".- Returns:
- value or
nullfor none - See Also:
-
- Tag definitions for more details.
-
getExternalDatasetReference
Returns information about the external metadata storage where the dataset is defined. Filled out when the dataset type is EXTERNAL. -
toBuilder
Returns a builder for the dataset object. -
toString
-
hashCode
public int hashCode() -
equals
-
newBuilder
Returns a builder for aDatasetInfoobject given it's identity. -
newBuilder
Returns a builder for aDatasetInfoobject given it's user-defined id. -
newBuilder
Returns a builder for the DatasetInfo object given it's user-defined project and dataset ids. -
of
Returns aDatasetInfoobject given it's identity. -
of
Returns aDatasetInfoobject given it's user-defined id. -
getOtelAttributes
protected io.opentelemetry.api.common.Attributes getOtelAttributes()
-