Tabnine Logo
Table$Builder.setDescription
Code IndexAdd Tabnine to your IDE (free)

How to use
setDescription
method
in
com.google.cloud.bigquery.Table$Builder

Best Java code snippets using com.google.cloud.bigquery.Table$Builder.setDescription (Showing top 6 results out of 315)

origin: googleapis/google-cloud-java

@Test
public void testUpdate() {
 initializeExpectedTable(4);
 Table expectedUpdatedTable = expectedTable.toBuilder().setDescription("Description").build();
 expect(bigquery.getOptions()).andReturn(mockOptions);
 expect(bigquery.update(eq(expectedTable))).andReturn(expectedUpdatedTable);
 replay(bigquery);
 initializeTable();
 Table actualUpdatedTable = table.update();
 compareTable(expectedUpdatedTable, actualUpdatedTable);
}
origin: googleapis/google-cloud-java

@Test
public void testUpdateWithOptions() {
 initializeExpectedTable(4);
 Table expectedUpdatedTable = expectedTable.toBuilder().setDescription("Description").build();
 expect(bigquery.getOptions()).andReturn(mockOptions);
 expect(bigquery.update(eq(expectedTable), eq(BigQuery.TableOption.fields())))
   .andReturn(expectedUpdatedTable);
 replay(bigquery);
 initializeTable();
 Table actualUpdatedTable = table.update(BigQuery.TableOption.fields());
 compareTable(expectedUpdatedTable, actualUpdatedTable);
}
origin: googleapis/google-cloud-java

@Test
public void testUpdateTable() {
 String tableName = "test_update_table";
 StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA);
 TableInfo tableInfo =
   TableInfo.newBuilder(TableId.of(DATASET, tableName), tableDefinition)
     .setDescription("Some Description")
     .setLabels(Collections.singletonMap("a", "b"))
     .build();
 Table createdTable = bigquery.create(tableInfo);
 assertThat(createdTable.getDescription()).isEqualTo("Some Description");
 assertThat(createdTable.getLabels()).containsExactly("a", "b");
 Map<String, String> updateLabels = new HashMap<>();
 updateLabels.put("x", "y");
 updateLabels.put("a", null);
 Table updatedTable =
   bigquery.update(
     createdTable
       .toBuilder()
       .setDescription("Updated Description")
       .setLabels(updateLabels)
       .build());
 assertThat(updatedTable.getDescription()).isEqualTo("Updated Description");
 assertThat(updatedTable.getLabels()).containsExactly("x", "y");
 updatedTable = bigquery.update(updatedTable.toBuilder().setLabels(null).build());
 assertThat(updatedTable.getLabels()).isEmpty();
 assertThat(createdTable.delete()).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void testBuilder() {
 initializeExpectedTable(2);
 replay(bigquery);
 Table builtTable =
   new Table.Builder(serviceMockReturnsOptions, TABLE_ID1, TABLE_DEFINITION)
     .setCreationTime(CREATION_TIME)
     .setDescription(DESCRIPTION)
     .setEtag(ETAG)
     .setExpirationTime(EXPIRATION_TIME)
     .setFriendlyName(FRIENDLY_NAME)
     .setGeneratedId(GENERATED_ID)
     .setLastModifiedTime(LAST_MODIFIED_TIME)
     .setSelfLink(SELF_LINK)
     .build();
 assertEquals(TABLE_ID1, builtTable.getTableId());
 assertEquals(CREATION_TIME, builtTable.getCreationTime());
 assertEquals(DESCRIPTION, builtTable.getDescription());
 assertEquals(ETAG, builtTable.getEtag());
 assertEquals(EXPIRATION_TIME, builtTable.getExpirationTime());
 assertEquals(FRIENDLY_NAME, builtTable.getFriendlyName());
 assertEquals(GENERATED_ID, builtTable.getGeneratedId());
 assertEquals(LAST_MODIFIED_TIME, builtTable.getLastModifiedTime());
 assertEquals(TABLE_DEFINITION, builtTable.getDefinition());
 assertEquals(SELF_LINK, builtTable.getSelfLink());
 assertSame(serviceMockReturnsOptions, builtTable.getBigQuery());
}
origin: googleapis/google-cloud-java

/** Example of updating a table by changing its description. */
public Table updateTableDescription(String datasetName, String tableName, String newDescription) {
 // [START bigquery_update_table_description]
 // String datasetName = "my_dataset_name";
 // String tableName = "my_table_name";
 // String newDescription = "new_description";
 Table beforeTable = bigquery.getTable(datasetName, tableName);
 TableInfo tableInfo = beforeTable.toBuilder().setDescription(newDescription).build();
 Table afterTable = bigquery.update(tableInfo);
 // [END bigquery_update_table_description]
 return afterTable;
}
origin: googleapis/google-cloud-java

/** Example of updating the table's information. */
// [TARGET update(TableOption...)]
public Table update() {
 // [START ]
 Table updatedTable = table.toBuilder().setDescription("new description").build().update();
 // [END ]
 return updatedTable;
}
com.google.cloud.bigqueryTable$BuildersetDescription

Popular methods of Table$Builder

  • <init>
  • build
  • setExpirationTime
  • setCreationTime
  • setDefinition
  • setEtag
  • setFriendlyName
  • setGeneratedId
  • setLabels
  • setLastModifiedTime
  • setSelfLink
  • setSelfLink

Popular in Java

  • Reading from database using SQL prepared statement
  • putExtra (Intent)
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Reference (javax.naming)
  • BoxLayout (javax.swing)
  • JComboBox (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now