Skip to content

Commit 8b2dc62

Browse files
committed
---
yaml --- r: 6897 b: refs/heads/tswast-patch-1 c: cdec697 h: refs/heads/master i: 6895: 0f33116
1 parent 08bab50 commit 8b2dc62

51 files changed

Lines changed: 2876 additions & 2253 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: 288c9935d84f82cd67318b27facb6025772225a6
60+
refs/heads/tswast-patch-1: cdec697470a3e55066936d7099a0f066ae5f3005
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,31 +125,33 @@ Here is a code snippet showing a simple usage example from within Compute/App En
125125
must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
126126
127127
```java
128-
import com.google.gcloud.bigquery.BaseTableInfo;
129128
import com.google.gcloud.bigquery.BigQuery;
130129
import com.google.gcloud.bigquery.BigQueryOptions;
131130
import com.google.gcloud.bigquery.Field;
131+
import com.google.gcloud.bigquery.Job;
132132
import com.google.gcloud.bigquery.JobStatus;
133133
import com.google.gcloud.bigquery.JobInfo;
134+
import com.google.gcloud.bigquery.LoadJobConfiguration;
134135
import com.google.gcloud.bigquery.Schema;
136+
import com.google.gcloud.bigquery.StandardTableDefinition;
137+
import com.google.gcloud.bigquery.Table;
135138
import com.google.gcloud.bigquery.TableId;
136139
import com.google.gcloud.bigquery.TableInfo;
137140
138141
BigQuery bigquery = BigQueryOptions.defaultInstance().service();
139142
TableId tableId = TableId.of("dataset", "table");
140-
BaseTableInfo info = bigquery.getTable(tableId);
141-
if (info == null) {
143+
Table table = bigquery.getTable(tableId);
144+
if (table == null) {
142145
System.out.println("Creating table " + tableId);
143146
Field integerField = Field.of("fieldName", Field.Type.integer());
144-
bigquery.create(TableInfo.of(tableId, Schema.of(integerField)));
147+
Schema schema = Schema.of(integerField);
148+
bigquery.create(TableInfo.of(tableId, StandardTableDefinition.of(schema)));
145149
} else {
146150
System.out.println("Loading data into table " + tableId);
147151
LoadJobConfiguration configuration = LoadJobConfiguration.of(tableId, "gs://bucket/path");
148-
JobInfo loadJob = JobInfo.of(configuration);
149-
loadJob = bigquery.create(loadJob);
150-
while (loadJob.status().state() != JobStatus.State.DONE) {
152+
Job loadJob = bigquery.create(JobInfo.of(configuration));
153+
while (!loadJob.isDone()) {
151154
Thread.sleep(1000L);
152-
loadJob = bigquery.getJob(loadJob.jobId());
153155
}
154156
if (loadJob.status().error() != null) {
155157
System.out.println("Job completed with errors");

branches/tswast-patch-1/gcloud-java-bigquery/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,10 @@ are created from a BigQuery SQL query. In this code snippet we show how to creat
111111
with only one string field. Add the following imports at the top of your file:
112112

113113
```java
114-
import com.google.gcloud.bigquery.BaseTableInfo;
115114
import com.google.gcloud.bigquery.Field;
116115
import com.google.gcloud.bigquery.Schema;
116+
import com.google.gcloud.bigquery.StandardTableDefinition;
117+
import com.google.gcloud.bigquery.Table;
117118
import com.google.gcloud.bigquery.TableId;
118119
import com.google.gcloud.bigquery.TableInfo;
119120
```
@@ -126,7 +127,8 @@ Field stringField = Field.of("StringField", Field.Type.string());
126127
// Table schema definition
127128
Schema schema = Schema.of(stringField);
128129
// Create a table
129-
TableInfo createdTableInfo = bigquery.create(TableInfo.of(tableId, schema));
130+
StandardTableDefinition tableDefinition = StandardTableDefinition.of(schema);
131+
Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition));
130132
```
131133

132134
#### Loading data into a table
@@ -204,7 +206,6 @@ the code from the main method to your application's servlet class and change the
204206
display on your webpage.
205207

206208
```java
207-
import com.google.gcloud.bigquery.BaseTableInfo;
208209
import com.google.gcloud.bigquery.BigQuery;
209210
import com.google.gcloud.bigquery.BigQueryOptions;
210211
import com.google.gcloud.bigquery.DatasetInfo;
@@ -215,6 +216,8 @@ import com.google.gcloud.bigquery.InsertAllResponse;
215216
import com.google.gcloud.bigquery.QueryRequest;
216217
import com.google.gcloud.bigquery.QueryResponse;
217218
import com.google.gcloud.bigquery.Schema;
219+
import com.google.gcloud.bigquery.StandardTableDefinition;
220+
import com.google.gcloud.bigquery.Table;
218221
import com.google.gcloud.bigquery.TableId;
219222
import com.google.gcloud.bigquery.TableInfo;
220223

@@ -240,7 +243,8 @@ public class GcloudBigQueryExample {
240243
// Table schema definition
241244
Schema schema = Schema.of(stringField);
242245
// Create a table
243-
TableInfo createdTableInfo = bigquery.create(TableInfo.of(tableId, schema));
246+
StandardTableDefinition tableDefinition = StandardTableDefinition.of(schema);
247+
Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition));
244248

245249
// Define rows to insert
246250
Map<String, Object> firstRow = new HashMap<>();
@@ -267,7 +271,7 @@ public class GcloudBigQueryExample {
267271
.build();
268272
// Request query to be executed and wait for results
269273
QueryResponse queryResponse = bigquery.query(queryRequest);
270-
while (!queryResponse.jobComplete()) {
274+
while (!queryResponse.jobCompleted()) {
271275
Thread.sleep(1000L);
272276
queryResponse = bigquery.getQueryResults(queryResponse.jobId());
273277
}

branches/tswast-patch-1/gcloud-java-bigquery/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.google.gcloud</groupId>
54
<artifactId>gcloud-java-bigquery</artifactId>
65
<packaging>jar</packaging>
76
<name>GCloud Java bigquery</name>

branches/tswast-patch-1/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Acl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ Access toPb() {
325325
*/
326326
public static final class View extends Entity {
327327

328+
private static final long serialVersionUID = -6851072781269419383L;
329+
328330
private final TableId id;
329331

330332
/**

0 commit comments

Comments
 (0)