Skip navigation links

Package com.google.cloud.bigquery

A client for BigQuery – A fully managed, petabyte scale, low cost enterprise data warehouse for analytics.

See: Description

Package com.google.cloud.bigquery Description

A client for BigQuery – A fully managed, petabyte scale, low cost enterprise data warehouse for analytics.

A simple usage example showing how to create a table in Bigquery. For the complete source code see CreateTable.java.

  try {
       // Initialize client that will be used to send requests. This client only needs to be created
       // once, and can be reused for multiple requests.
       BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();

       TableId tableId = TableId.of(datasetName, tableName);
       TableDefinition tableDefinition = StandardTableDefinition.of(schema);
       TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build();

       bigquery.create(tableInfo);
       System.out.println("Table created successfully");
     } catch (BigQueryException e) {
       System.out.println("Table was not created. \n" + e.toString());
     }
 
See Also:
Google Cloud BigQuery
Skip navigation links

Copyright © 2023 Google LLC. All rights reserved.