com.google.cloud.bigquery.Dataset

Here are the examples of the java api class com.google.cloud.bigquery.Dataset taken from open source projects.

1. ITBigQueryTest#testUpdateDataset()

Project: gcloud-java
Source File: ITBigQueryTest.java
View license
@Test
public void testUpdateDataset() {
    Dataset dataset = bigquery.create(DatasetInfo.builder(OTHER_DATASET).description("Some Description").build());
    assertNotNull(dataset);
    assertEquals(bigquery.options().projectId(), dataset.datasetId().project());
    assertEquals(OTHER_DATASET, dataset.datasetId().dataset());
    assertEquals("Some Description", dataset.description());
    Dataset updatedDataset = bigquery.update(dataset.toBuilder().description("Updated Description").build());
    assertEquals("Updated Description", updatedDataset.description());
    assertTrue(dataset.delete());
}

2. ITBigQueryTest#testUpdateDatasetWithSelectedFields()

Project: gcloud-java
Source File: ITBigQueryTest.java
View license
@Test
public void testUpdateDatasetWithSelectedFields() {
    Dataset dataset = bigquery.create(DatasetInfo.builder(OTHER_DATASET).description("Some Description").build());
    assertNotNull(dataset);
    assertEquals(bigquery.options().projectId(), dataset.datasetId().project());
    assertEquals(OTHER_DATASET, dataset.datasetId().dataset());
    assertEquals("Some Description", dataset.description());
    Dataset updatedDataset = bigquery.update(dataset.toBuilder().description("Updated Description").build(), DatasetOption.fields(DatasetField.DESCRIPTION));
    assertEquals("Updated Description", updatedDataset.description());
    assertNull(updatedDataset.creationTime());
    assertNull(updatedDataset.defaultTableLifetime());
    assertNull(updatedDataset.acl());
    assertNull(updatedDataset.etag());
    assertNull(updatedDataset.friendlyName());
    assertNull(updatedDataset.generatedId());
    assertNull(updatedDataset.lastModified());
    assertNull(updatedDataset.location());
    assertNull(updatedDataset.selfLink());
    assertTrue(dataset.delete());
}

3. ITBigQueryTest#testGetDataset()

Project: gcloud-java
Source File: ITBigQueryTest.java
View license
@Test
public void testGetDataset() {
    Dataset dataset = bigquery.getDataset(DATASET);
    assertEquals(bigquery.options().projectId(), dataset.datasetId().project());
    assertEquals(DATASET, dataset.datasetId().dataset());
    assertEquals(DESCRIPTION, dataset.description());
    assertNotNull(dataset.acl());
    assertNotNull(dataset.etag());
    assertNotNull(dataset.generatedId());
    assertNotNull(dataset.lastModified());
    assertNotNull(dataset.selfLink());
}

4. ITBigQueryTest#testGetDatasetWithSelectedFields()

Project: gcloud-java
Source File: ITBigQueryTest.java
View license
@Test
public void testGetDatasetWithSelectedFields() {
    Dataset dataset = bigquery.getDataset(DATASET, DatasetOption.fields(DatasetField.CREATION_TIME));
    assertEquals(bigquery.options().projectId(), dataset.datasetId().project());
    assertEquals(DATASET, dataset.datasetId().dataset());
    assertNotNull(dataset.creationTime());
    assertNull(dataset.description());
    assertNull(dataset.defaultTableLifetime());
    assertNull(dataset.acl());
    assertNull(dataset.etag());
    assertNull(dataset.friendlyName());
    assertNull(dataset.generatedId());
    assertNull(dataset.lastModified());
    assertNull(dataset.location());
    assertNull(dataset.selfLink());
}