google-cloud-bigquery overview (2.37.2)

com.google.cloud.bigquery

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.


BigQuerybigquery=BigQueryOptions.getDefaultInstance().getService();*
TableIdtableId=TableId.of(datasetName,tableName);
TableDefinitiontableDefinition=StandardTableDefinition.of(schema);
TableInfotableInfo=TableInfo.newBuilder(tableId,tableDefinition).build();*
bigquery.create(tableInfo);
System.out.println("Table created successfully");

See Also: Google Cloud BigQuery

com.google.cloud.bigquery.benchmark

com.google.cloud.bigquery.spi

com.google.cloud.bigquery.spi.v2

com.google.cloud.bigquery.testing

A testing helper for Google BigQuery.

A simple usage example: 1. Create a test Google Cloud project.

2. Download a JSON service account credentials file from the Google Developer's Console.

3. Create a RemoteBigQueryHelper object using your project ID and JSON key. Here is an example that uses the RemoteBigQueryHelper to create a dataset.

4. Run tests.

Before the test:


RemoteBigQueryHelperbigqueryHelper=RemoteBigQueryHelper.create();
BigQuerybigquery=bigqueryHelper.getOptions().getService();
Stringdataset=RemoteBigQueryHelper.generateDatasetName();
bigquery.create(DatasetInfo.newBuilder(dataset).build());

After the test:


RemoteBigQueryHelper.forceDelete(bigquery,DATASET);

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.