Class Dataset.Builder (2.55.2)
public static final class Dataset.Builder extends DatasetInfo.Builder
A builder for Dataset
objects.
Methods
build()
Creates a DatasetInfo
object.
Overrides
setAcl(List<Acl> acl)
public Dataset.Builder setAcl(List<Acl> acl)
Sets the dataset's access control configuration.
Parameter |
Name |
Description |
acl |
List<Acl>
|
Overrides
setDatasetId(DatasetId datasetId)
public Dataset.Builder setDatasetId(DatasetId datasetId)
Sets the dataset identity.
Parameter |
Name |
Description |
datasetId |
DatasetId
|
Overrides
setDefaultCollation(String defaultCollation)
public Dataset.Builder setDefaultCollation(String defaultCollation)
Optional. 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 --)
Parameter |
Name |
Description |
defaultCollation |
String
|
Overrides
setDefaultEncryptionConfiguration(EncryptionConfiguration defaultEncryptionConfiguration)
public Dataset.Builder setDefaultEncryptionConfiguration(EncryptionConfiguration defaultEncryptionConfiguration)
The 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.
Overrides
setDefaultPartitionExpirationMs(Long defaultPartitionExpirationMs)
public Dataset.Builder setDefaultPartitionExpirationMs(Long defaultPartitionExpirationMs)
[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 be null
.
Parameter |
Name |
Description |
defaultPartitionExpirationMs |
Long
|
Overrides
setDefaultTableLifetime(Long defaultTableLifetime)
public Dataset.Builder setDefaultTableLifetime(Long defaultTableLifetime)
Sets 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.
Parameter |
Name |
Description |
defaultTableLifetime |
Long
|
Overrides
setDescription(String description)
public Dataset.Builder setDescription(String description)
Sets a user-friendly description for the dataset.
Parameter |
Name |
Description |
description |
String
|
Overrides
setExternalDatasetReference(ExternalDatasetReference externalDatasetReference)
public Dataset.Builder setExternalDatasetReference(ExternalDatasetReference externalDatasetReference)
Optional. Information about the external metadata storage where the dataset is defined.
Filled out when the dataset type is EXTERNAL
Overrides
setFriendlyName(String friendlyName)
public Dataset.Builder setFriendlyName(String friendlyName)
Sets a user-friendly name for the dataset.
Parameter |
Name |
Description |
friendlyName |
String
|
Overrides
setLabels(Map<String,String> labels)
public Dataset.Builder setLabels(Map<String,String> labels)
Overrides
setLocation(String location)
public Dataset.Builder setLocation(String location)
Sets the geographic location where the dataset should reside. This property is experimental
and might be subject to change or removed.
Parameter |
Name |
Description |
location |
String
|
Overrides
setMaxTimeTravelHours(Long maxTimeTravelHours)
public Dataset.Builder setMaxTimeTravelHours(Long maxTimeTravelHours)
Optional. Defines the time travel window in hours. The value can be from 48 to 168 hours (2
to 7 days). The default value is 168 hours if this is not set. The value may be null
.
Parameter |
Name |
Description |
maxTimeTravelHours |
Long
|
Overrides
public Dataset.Builder setResourceTags(Map<String,String> resourceTags)
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".
Overrides
setStorageBillingModel(String storageBillingModel)
public Dataset.Builder setStorageBillingModel(String storageBillingModel)
Optional. Storage billing model to be used for all tables in the dataset. Can be set to
PHYSICAL. Default is LOGICAL.
Parameter |
Name |
Description |
storageBillingModel |
String
|
Overrides
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-11 UTC."],[],[]]