public class BigQueryExample extends Object
This example demonstrates a simple/typical BigQuery usage.
Steps needed for running the example:
gcloud auth login.mvn compilemvn exec:java -Dexec.mainClass="com.google.cloud.examples.bigquery.BigQueryExample"
-Dexec.args="[<project_id>]
list datasets |
list tables <dataset> |
list jobs |
list data <dataset> <table> |
info dataset <dataset> |
info table <dataset> <table> |
info job <job> |
create dataset <dataset> |
create table <dataset> <table> (<fieldName>:<primitiveType>)+ |
create view <dataset> <table> <query> |
create external-table <dataset> <table> <format> (<fieldName>:<primitiveType>)+ <sourceUri> |
delete dataset <dataset> |
delete table <dataset> <table> |
cancel <job> |
copy <sourceDataset> <sourceTable> <destinationDataset> <destinationTable> |
load <dataset> <table> <format> <sourceUri>+ |
extract <dataset> <table> <format> <destinationUri>+ |
query <query> |
load-file <dataset> <table> <format> <filePath>"
The first parameter is an optional project_id (logged-in project will be used if not
supplied). Second parameter is a BigQuery operation and can be used to demonstrate its usage. For
operations that apply to more than one entity (`list`, `create`, `info` and `delete`) the third
parameter specifies the entity. <primitiveType> indicates that only primitive types are
supported by the create table and create external-table operations
(string, float, integer, timestamp, boolean).
<sourceUri>, <sourceUris> and <destinationUris> parameters are URIs to
Google Cloud Storage blobs, in the form gs://bucket/path. See each action's run method
for the specific BigQuery interaction.
| Constructor and Description |
|---|
BigQueryExample() |
Copyright © 2016 Google. All rights reserved.