Tabnine Logo
TableId.of
Code IndexAdd Tabnine to your IDE (free)

How to use
of
method
in
com.google.cloud.bigquery.TableId

Best Java code snippets using com.google.cloud.bigquery.TableId.of (Showing top 20 results out of 315)

origin: googleapis/google-cloud-java

@Override
TableId parse(String... args) throws Exception {
 String message;
 if (args.length == 2) {
  return TableId.of(args[0], args[1]);
 } else if (args.length < 2) {
  message = "Missing required dataset and table id.";
 } else {
  message = "Too many arguments.";
 }
 throw new IllegalArgumentException(message);
}
origin: googleapis/google-cloud-java

@Override
public TableResult listTableData(
  String datasetId, String tableId, TableDataListOption... options) {
 return listTableData(TableId.of(datasetId, tableId), options);
}
origin: googleapis/google-cloud-java

@Override
public TableResult listTableData(
  String datasetId, String tableId, Schema schema, TableDataListOption... options) {
 return listTableData(TableId.of(datasetId, tableId), schema, options);
}
origin: googleapis/google-cloud-java

/**
 * Returns a builder for an {@code InsertAllRequest} object given the destination table and the
 * rows to insert.
 */
public static Builder newBuilder(String datasetId, String tableId, RowToInsert... rows) {
 return newBuilder(TableId.of(datasetId, tableId), rows);
}
origin: googleapis/google-cloud-java

/** Example of getting a table. */
// [TARGET getTable(TableId, TableOption...)]
// [VARIABLE "my_project_id"]
// [VARIABLE "my_dataset_name"]
// [VARIABLE "my_table_name"]
public Table getTableFromId(String projectId, String datasetName, String tableName) {
 // [START bigquery_get_table]
 TableId tableId = TableId.of(projectId, datasetName, tableName);
 Table table = bigquery.getTable(tableId);
 // [END bigquery_get_table]
 return table;
}
origin: googleapis/google-cloud-java

/**
 * Returns a builder for an {@code InsertAllRequest} object given the destination table and the
 * rows to insert.
 */
public static Builder newBuilder(String datasetId, String tableId, Iterable<RowToInsert> rows) {
 return newBuilder(TableId.of(datasetId, tableId), rows);
}
origin: googleapis/google-cloud-java

@Override
public boolean delete(String datasetId, String tableId) {
 return delete(TableId.of(datasetId, tableId));
}
origin: googleapis/google-cloud-java

TableId setProjectId(String projectId) {
 Preconditions.checkArgument(
   !Strings.isNullOrEmpty(projectId), "Provided projectId is null or empty");
 return TableId.of(projectId, getDataset(), getTable());
}
origin: googleapis/google-cloud-java

/** Returns a builder for an {@code InsertAllRequest} object given the destination table. */
public static Builder newBuilder(String datasetId, String tableId) {
 return new Builder().setTable(TableId.of(datasetId, tableId));
}
origin: googleapis/google-cloud-java

@Override
TableInfo parse(String... args) throws Exception {
 if (args.length >= 3) {
  String dataset = args[0];
  String table = args[1];
  TableId tableId = TableId.of(dataset, table);
  return TableInfo.of(tableId, StandardTableDefinition.of(parseSchema(args, 2, args.length)));
 }
 throw new IllegalArgumentException("Missing required arguments.");
}
origin: googleapis/google-cloud-java

@Test
public void testEquals() {
 compareTableIds(TABLE, TableId.of("dataset", "table"));
 compareTableIds(TABLE_COMPLETE, TableId.of("project", "dataset", "table"));
}
origin: googleapis/google-cloud-java

@Test
public void testSetProjectId() {
 TableId differentProjectTable = TableId.of("differentProject", "dataset", "table");
 assertEquals(differentProjectTable, TABLE.setProjectId("differentProject"));
}
origin: googleapis/google-cloud-java

@Test
public void testListTableDataFromTableId() {
 EasyMock.expect(bigqueryRpcMock.listTableData(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS))
   .andReturn(TABLE_DATA_PB);
 EasyMock.replay(bigqueryRpcMock);
 bigquery = options.getService();
 Page<FieldValueList> page = bigquery.listTableData(TableId.of(DATASET, TABLE));
 assertEquals(CURSOR, page.getNextPageToken());
 assertArrayEquals(TABLE_DATA.toArray(), Iterables.toArray(page.getValues(), List.class));
}
origin: googleapis/google-cloud-java

@Test
public void testDeleteTableFromTableIdWithoutProject() {
 TableId tableId = TableId.of("", TABLE_ID.getDataset(), TABLE_ID.getTable());
 EasyMock.expect(bigqueryRpcMock.deleteTable(PROJECT, DATASET, TABLE)).andReturn(true);
 EasyMock.replay(bigqueryRpcMock);
 BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(PROJECT, rpcFactoryMock);
 bigquery = bigQueryOptions.getService();
 assertTrue(bigquery.delete(tableId));
}
origin: googleapis/google-cloud-java

@Test
public void testGetTableFromTableIdWithoutProject() {
 TableInfo tableInfo = TABLE_INFO.setProjectId(PROJECT);
 TableId tableId = TableId.of("", TABLE_ID.getDataset(), TABLE_ID.getTable());
 EasyMock.expect(bigqueryRpcMock.getTable(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS))
   .andReturn(tableInfo.toPb());
 EasyMock.replay(bigqueryRpcMock);
 BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(PROJECT, rpcFactoryMock);
 bigquery = bigQueryOptions.getService();
 Table table = bigquery.getTable(tableId);
 assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(tableInfo)), table);
}
origin: googleapis/google-cloud-java

@Test
public void testUpdateTableWithoutProject() {
 TableInfo tableInfo = TABLE_INFO.setProjectId(PROJECT);
 TableId tableId = TableId.of("", TABLE_ID.getDataset(), TABLE_ID.getTable());
 tableInfo.toBuilder().setTableId(tableId);
 EasyMock.expect(bigqueryRpcMock.patch(tableInfo.toPb(), EMPTY_RPC_OPTIONS))
   .andReturn(tableInfo.toPb());
 EasyMock.replay(bigqueryRpcMock);
 BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(PROJECT, rpcFactoryMock);
 bigquery = bigQueryOptions.getService();
 Table table = bigquery.update(tableInfo);
 assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(tableInfo)), table);
}
origin: googleapis/google-cloud-java

@Test
public void testViewEntity() {
 TableId viewId = TableId.of("project", "dataset", "view");
 View entity = new View(viewId);
 assertEquals(viewId, entity.getId());
 assertEquals(Type.VIEW, entity.getType());
 Dataset.Access pb = entity.toPb();
 assertEquals(entity, Entity.fromPb(pb));
}
origin: googleapis/google-cloud-java

@Test
public void testToBuilder() {
 compareExtractJobConfiguration(
   EXTRACT_CONFIGURATION, EXTRACT_CONFIGURATION.toBuilder().build());
 ExtractJobConfiguration job =
   EXTRACT_CONFIGURATION.toBuilder().setSourceTable(TableId.of("dataset", "newTable")).build();
 assertEquals("newTable", job.getSourceTable().getTable());
 job = job.toBuilder().setSourceTable(TABLE_ID).build();
 compareExtractJobConfiguration(EXTRACT_CONFIGURATION, job);
}
origin: googleapis/google-cloud-java

@Test
public void testToBuilder() {
 compareLoadConfiguration(LOAD_CONFIGURATION_CSV, LOAD_CONFIGURATION_CSV.toBuilder().build());
 WriteChannelConfiguration configuration =
   LOAD_CONFIGURATION_CSV
     .toBuilder()
     .setDestinationTable(TableId.of("dataset", "newTable"))
     .build();
 assertEquals("newTable", configuration.getDestinationTable().getTable());
 configuration = configuration.toBuilder().setDestinationTable(TABLE_ID).build();
 compareLoadConfiguration(LOAD_CONFIGURATION_CSV, configuration);
}
origin: googleapis/google-cloud-java

 @Test
 public void testOf() {
  Acl acl = Acl.of(Group.ofAllAuthenticatedUsers(), Role.READER);
  assertEquals(Group.ofAllAuthenticatedUsers(), acl.getEntity());
  assertEquals(Role.READER, acl.getRole());
  Dataset.Access pb = acl.toPb();
  assertEquals(acl, Acl.fromPb(pb));
  View view = new View(TableId.of("project", "dataset", "view"));
  acl = Acl.of(view);
  assertEquals(view, acl.getEntity());
  assertEquals(null, acl.getRole());
 }
}
com.google.cloud.bigqueryTableIdof

Javadoc

Creates a table identity given dataset's and table's user-defined ids.

Popular methods of TableId

  • getTable
    Returns table's user-defined id.
  • getDataset
    Returns dataset's user-defined id.
  • getProject
    Returns project's user-defined id.
  • fromPb
  • equals
  • hashCode
  • setProjectId
  • toPb
  • <init>
  • toString
  • dataset
    Returns dataset's user-defined id.
  • project
    Returns project's user-defined id.
  • dataset,
  • project,
  • table

Popular in Java

  • Reading from database using SQL prepared statement
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • 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