Skip to content

Commit 23a3fd1

Browse files
committed
---
yaml --- r: 2631 b: refs/heads/update-datastore c: afe953d h: refs/heads/master i: 2629: d8c49f9 2627: fa4e7cf 2623: 410e477
1 parent 744fc03 commit 23a3fd1

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
66
refs/heads/pubsub-alpha: 1a0e970f265af871e02274085b9662b3fe29058b
77
refs/heads/resource-manager: ebf4adc5ee835cd2086c4ac5b4e78d01a5a005a7
8-
refs/heads/update-datastore: ca0c26538bb614ba1e34343385ff10ed56e79e0b
8+
refs/heads/update-datastore: afe953de798df407060753a591ea0b19e972bf34
99
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
1010
refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd
1111
refs/tags/v0.0.11: ffbfba48a6426ff63c08ff2117e58681f251fbf2

branches/update-datastore/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/package-info.java

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,28 @@
1818
* A client to Google Cloud BigQuery.
1919
*
2020
* <p>A simple usage example:
21-
* <pre>{@code
22-
* //TODO(mziccard): add code example
23-
* }</pre>
21+
* <pre> {@code
22+
* BigQuery bigquery = BigQueryOptions.defaultInstance().service();
23+
* TableId tableId = TableId.of("dataset", "table");
24+
* BaseTableInfo info = bigquery.getTable(tableId);
25+
* if (info == null) {
26+
* System.out.println("Creating table " + tableId);
27+
* Field integerField = Field.of("fieldName", Field.Type.integer());
28+
* bigquery.create(TableInfo.of(tableId, Schema.of(integerField)));
29+
* } else {
30+
* System.out.println("Loading data into table " + tableId);
31+
* LoadJobInfo loadJob = LoadJobInfo.of(tableId, "gs://bucket/path");
32+
* loadJob = bigquery.create(loadJob);
33+
* while (loadJob.status().state() != JobStatus.State.DONE) {
34+
* Thread.sleep(1000L);
35+
* loadJob = bigquery.getJob(loadJob.jobId());
36+
* }
37+
* if (loadJob.status().error() != null) {
38+
* System.out.println("Job completed with errors");
39+
* } else {
40+
* System.out.println("Job succeeded");
41+
* }
42+
* }}</pre>
2443
*
2544
* @see <a href="https://cloud.google.com/bigquery/">Google Cloud BigQuery</a>
2645
*/

0 commit comments

Comments
 (0)