Package com.google.cloud.bigquery
Class Dataset.Builder
- java.lang.Object
-
- com.google.cloud.bigquery.DatasetInfo.Builder
-
- com.google.cloud.bigquery.Dataset.Builder
-
- Enclosing class:
- Dataset
public static final class Dataset.Builder extends DatasetInfo.Builder
A builder forDatasetobjects.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Datasetbuild()Creates aDatasetInfoobject.Dataset.BuildersetAcl(List<Acl> acl)Sets the dataset's access control configuration.Dataset.BuildersetDatasetId(DatasetId datasetId)Sets the dataset identity.Dataset.BuildersetDefaultCollation(String defaultCollation)Optional.Dataset.BuildersetDefaultEncryptionConfiguration(EncryptionConfiguration defaultEncryptionConfiguration)The default encryption key for all tables in the dataset.Dataset.BuildersetDefaultPartitionExpirationMs(Long defaultPartitionExpirationMs)[Optional] The default partition expiration time for all partitioned tables in the dataset, in milliseconds.Dataset.BuildersetDefaultTableLifetime(Long defaultTableLifetime)Sets the default lifetime of all tables in the dataset, in milliseconds.Dataset.BuildersetDescription(String description)Sets a user-friendly description for the dataset.Dataset.BuildersetExternalDatasetReference(ExternalDatasetReference externalDatasetReference)Optional.Dataset.BuildersetFriendlyName(String friendlyName)Sets a user-friendly name for the dataset.Dataset.BuildersetLabels(Map<String,String> labels)Dataset.BuildersetLocation(String location)Sets the geographic location where the dataset should reside.
-
-
-
Method Detail
-
setDatasetId
public Dataset.Builder setDatasetId(DatasetId datasetId)
Description copied from class:DatasetInfo.BuilderSets the dataset identity.- Specified by:
setDatasetIdin classDatasetInfo.Builder
-
setAcl
public Dataset.Builder setAcl(List<Acl> acl)
Description copied from class:DatasetInfo.BuilderSets the dataset's access control configuration.- Specified by:
setAclin classDatasetInfo.Builder- See Also:
- Access Control
-
setDefaultTableLifetime
public Dataset.Builder setDefaultTableLifetime(Long defaultTableLifetime)
Description copied from class:DatasetInfo.BuilderSets 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. This property is experimental and might be subject to change or removed.- Specified by:
setDefaultTableLifetimein classDatasetInfo.Builder
-
setDescription
public Dataset.Builder setDescription(String description)
Description copied from class:DatasetInfo.BuilderSets a user-friendly description for the dataset.- Specified by:
setDescriptionin classDatasetInfo.Builder
-
setFriendlyName
public Dataset.Builder setFriendlyName(String friendlyName)
Description copied from class:DatasetInfo.BuilderSets a user-friendly name for the dataset.- Specified by:
setFriendlyNamein classDatasetInfo.Builder
-
setLocation
public Dataset.Builder setLocation(String location)
Description copied from class:DatasetInfo.BuilderSets the geographic location where the dataset should reside. This property is experimental and might be subject to change or removed.- Specified by:
setLocationin classDatasetInfo.Builder- See Also:
- Dataset Location
-
setLabels
public Dataset.Builder setLabels(Map<String,String> labels)
- Specified by:
setLabelsin classDatasetInfo.Builder
-
setDefaultEncryptionConfiguration
public Dataset.Builder setDefaultEncryptionConfiguration(EncryptionConfiguration defaultEncryptionConfiguration)
Description copied from class:DatasetInfo.BuilderThe default encryption key for all tables in the dataset. Once this property is set, all newly-created partitioned tables in the dataset will have encryption key set to this value, unless table creation request (or query) overrides the key.- Specified by:
setDefaultEncryptionConfigurationin classDatasetInfo.Builder
-
setDefaultPartitionExpirationMs
public Dataset.Builder setDefaultPartitionExpirationMs(Long defaultPartitionExpirationMs)
Description copied from class:DatasetInfo.Builder[Optional] The default partition expiration time for all partitioned tables in the dataset, in milliseconds. Once this property is set, all newly-created partitioned tables in the dataset will has an expirationMs property in the timePartitioning settings set to this value. Changing the value 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. The value may benull.- Specified by:
setDefaultPartitionExpirationMsin classDatasetInfo.Builder
-
setDefaultCollation
public Dataset.Builder setDefaultCollation(String defaultCollation)
Description copied from class:DatasetInfo.BuilderOptional. Defines the default collation specification of future tables created in the dataset. If a table is created in this dataset without table-level default collation, then the table inherits the dataset default collation, which is applied to the string fields that do not have explicit collation specified. A change to this field affects only tables created afterwards, and does not alter the existing tables. The following values are supported:* 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to case-sensitive behavior. (-- A wrapper is used here because it is possible to set the value to the empty string. --) (-- api-linter: standard-fields=disabled --)
- Specified by:
setDefaultCollationin classDatasetInfo.Builder
-
setExternalDatasetReference
public Dataset.Builder setExternalDatasetReference(ExternalDatasetReference externalDatasetReference)
Description copied from class:DatasetInfo.BuilderOptional. Information about the external metadata storage where the dataset is defined. Filled out when the dataset type is EXTERNAL- Specified by:
setExternalDatasetReferencein classDatasetInfo.Builder
-
build
public Dataset build()
Description copied from class:DatasetInfo.BuilderCreates aDatasetInfoobject.- Specified by:
buildin classDatasetInfo.Builder
-
-