Send feedback
Class DatasetInfo (2.42.3)
Stay organized with collections
Save and categorize content based on your preferences.
Version latest keyboard_arrow_down
public class DatasetInfo implements Serializable
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.
See Also: Managing Jobs, Datasets, and Projects
Inheritance
Object >
DatasetInfo
Static Methods
newBuilder(DatasetId datasetId)
public static DatasetInfo . Builder newBuilder ( DatasetId datasetId )
Returns a builder for a DatasetInfo
object given it's identity.
Parameter
Name
Description
datasetId
DatasetId
newBuilder(String datasetId)
public static DatasetInfo . Builder newBuilder ( String datasetId )
Returns a builder for a DatasetInfo
object given it's user-defined id.
Parameter
Name
Description
datasetId
String
newBuilder(String projectId, String datasetId)
public static DatasetInfo . Builder newBuilder ( String projectId , String datasetId )
Returns a builder for the DatasetInfo object given it's user-defined project and dataset ids.
Parameters
Name
Description
projectId
String
datasetId
String
of(DatasetId datasetId)
public static DatasetInfo of ( DatasetId datasetId )
Returns a DatasetInfo
object given it's identity.
Parameter
Name
Description
datasetId
DatasetId
of(String datasetId)
public static DatasetInfo of ( String datasetId )
Returns a DatasetInfo
object given it's user-defined id.
Parameter
Name
Description
datasetId
String
Methods
equals(Object obj)
public boolean equals ( Object obj )
Parameter
Name
Description
obj
Object
Overrides
getAcl()
public List<Acl> 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: Access Control
getCreationTime()
public Long getCreationTime ()
Returns the time when this dataset was created, in milliseconds since the epoch.
Returns
Type
Description
Long
getDatasetId()
public DatasetId getDatasetId ()
Returns the dataset identity.
getDefaultCollation()
public String getDefaultCollation ()
Returns
Type
Description
String
getDefaultEncryptionConfiguration()
public EncryptionConfiguration getDefaultEncryptionConfiguration ()
getDefaultPartitionExpirationMs()
public Long getDefaultPartitionExpirationMs ()
Returns
Type
Description
Long
getDefaultTableLifetime()
public Long 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.
Returns
Type
Description
Long
getDescription()
public String getDescription ()
Returns a user-friendly description for the dataset.
Returns
Type
Description
String
getEtag()
Returns the hash of the dataset resource.
Returns
Type
Description
String
getExternalDatasetReference()
public ExternalDatasetReference getExternalDatasetReference ()
Returns information about the external metadata storage where the dataset is defined. Filled
out when the dataset type is EXTERNAL.
getFriendlyName()
public String getFriendlyName ()
Returns a user-friendly name for the dataset.
Returns
Type
Description
String
getGeneratedId()
public String getGeneratedId ()
Returns the service-generated id for the dataset.
Returns
Type
Description
String
getLabels()
public Map<String , String> getLabels ()
getLastModified()
public Long getLastModified ()
Returns the time when this dataset or any of its tables was last modified, in milliseconds
since the epoch.
Returns
Type
Description
Long
getLocation()
public String getLocation ()
Returns the geographic location where the dataset should reside.
See Also: Dataset Location
Returns
Type
Description
String
getSelfLink()
public String getSelfLink ()
Returns an URL that can be used to access the resource again. The returned URL can be used for
get or update requests.
Returns
Type
Description
String
getStorageBillingModel()
public String getStorageBillingModel ()
Returns
Type
Description
String
hashCode()
Returns
Type
Description
int
Overrides
toBuilder()
public DatasetInfo . Builder toBuilder ()
Returns a builder for the dataset object.
toString()
Returns
Type
Description
String
Overrides
Send feedback
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 2024-10-01 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-10-01 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 2024-10-01 UTC."]]