Search in sources :

Example 1 with Builder

use of com.google.cloud.bigquery.Dataset.Builder in project google-cloud-java by GoogleCloudPlatform.

the class ITDatasetSnippets method testReload.

@Test
public void testReload() {
    assertNull(dataset.getFriendlyName());
    Builder builder = dataset.toBuilder();
    builder.setFriendlyName(FRIENDLY_NAME);
    builder.build().update();
    Dataset reloadedDataset = datasetSnippets.reloadDataset();
    assertEquals(FRIENDLY_NAME, reloadedDataset.getFriendlyName());
}
Also used : Dataset(com.google.cloud.bigquery.Dataset) Builder(com.google.cloud.bigquery.Dataset.Builder) Test(org.junit.Test)

Example 2 with Builder

use of com.google.cloud.bigquery.Dataset.Builder in project google-cloud-java by GoogleCloudPlatform.

the class DatasetSnippets method updateDataset.

/**
   * Example of updating a dataset.
   */
// [TARGET update(DatasetOption...)]
// [VARIABLE "my_friendly_name"]
public Dataset updateDataset(String friendlyName) {
    // [START update]
    Builder builder = dataset.toBuilder();
    builder.setFriendlyName(friendlyName);
    Dataset updatedDataset = builder.build().update();
    // [END update]
    return updatedDataset;
}
Also used : Dataset(com.google.cloud.bigquery.Dataset) Builder(com.google.cloud.bigquery.Dataset.Builder)

Aggregations

Dataset (com.google.cloud.bigquery.Dataset)2 Builder (com.google.cloud.bigquery.Dataset.Builder)2 Test (org.junit.Test)1