Skip to content

Commit 640797f

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 6891 b: refs/heads/tswast-patch-1 c: 3d1c1c8 h: refs/heads/master i: 6889: 2881c97 6887: 5a36790
1 parent b951d7b commit 640797f

68 files changed

Lines changed: 3453 additions & 3828 deletions

File tree

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: 8ba9230770179c61c5eaf836539b2fbd4e66f8a4
60+
refs/heads/tswast-patch-1: 3d1c1c80b29ede59fe1c33f26be56b2901e5a29a
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,33 +125,31 @@ 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;
128129
import com.google.gcloud.bigquery.BigQuery;
129130
import com.google.gcloud.bigquery.BigQueryOptions;
130131
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;
135134
import com.google.gcloud.bigquery.Schema;
136-
import com.google.gcloud.bigquery.StandardTableDefinition;
137-
import com.google.gcloud.bigquery.Table;
138135
import com.google.gcloud.bigquery.TableId;
139136
import com.google.gcloud.bigquery.TableInfo;
140137
141138
BigQuery bigquery = BigQueryOptions.defaultInstance().service();
142139
TableId tableId = TableId.of("dataset", "table");
143-
Table table = bigquery.getTable(tableId);
144-
if (table == null) {
140+
BaseTableInfo info = bigquery.getTable(tableId);
141+
if (info == null) {
145142
System.out.println("Creating table " + tableId);
146143
Field integerField = Field.of("fieldName", Field.Type.integer());
147-
Schema schema = Schema.of(integerField);
148-
bigquery.create(TableInfo.of(tableId, StandardTableDefinition.of(schema)));
144+
bigquery.create(TableInfo.of(tableId, Schema.of(integerField)));
149145
} else {
150146
System.out.println("Loading data into table " + tableId);
151147
LoadJobConfiguration configuration = LoadJobConfiguration.of(tableId, "gs://bucket/path");
152-
Job loadJob = bigquery.create(JobInfo.of(configuration));
153-
while (!loadJob.isDone()) {
148+
JobInfo loadJob = JobInfo.of(configuration);
149+
loadJob = bigquery.create(loadJob);
150+
while (loadJob.status().state() != JobStatus.State.DONE) {
154151
Thread.sleep(1000L);
152+
loadJob = bigquery.getJob(loadJob.jobId());
155153
}
156154
if (loadJob.status().error() != null) {
157155
System.out.println("Job completed with errors");
@@ -250,6 +248,7 @@ Here is a code snippet showing a simple usage example from within Compute/App En
250248
import static java.nio.charset.StandardCharsets.UTF_8;
251249
252250
import com.google.gcloud.storage.Blob;
251+
import com.google.gcloud.storage.BlobInfo;
253252
import com.google.gcloud.storage.BlobId;
254253
import com.google.gcloud.storage.Storage;
255254
import com.google.gcloud.storage.StorageOptions;
@@ -259,7 +258,7 @@ import java.nio.channels.WritableByteChannel;
259258
260259
Storage storage = StorageOptions.defaultInstance().service();
261260
BlobId blobId = BlobId.of("bucket", "blob_name");
262-
Blob blob = Blob.get(storage, blobId);
261+
Blob blob = storage.get(storage, blobId);
263262
if (blob == null) {
264263
BlobInfo blobInfo = BlobInfo.builder(blobId).contentType("text/plain").build();
265264
storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ 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;
114115
import com.google.gcloud.bigquery.Field;
115116
import com.google.gcloud.bigquery.Schema;
116-
import com.google.gcloud.bigquery.StandardTableDefinition;
117-
import com.google.gcloud.bigquery.Table;
118117
import com.google.gcloud.bigquery.TableId;
119118
import com.google.gcloud.bigquery.TableInfo;
120119
```
@@ -127,8 +126,7 @@ Field stringField = Field.of("StringField", Field.Type.string());
127126
// Table schema definition
128127
Schema schema = Schema.of(stringField);
129128
// Create a table
130-
StandardTableDefinition tableDefinition = StandardTableDefinition.of(schema);
131-
Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition));
129+
TableInfo createdTableInfo = bigquery.create(TableInfo.of(tableId, schema));
132130
```
133131

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

208206
```java
207+
import com.google.gcloud.bigquery.BaseTableInfo;
209208
import com.google.gcloud.bigquery.BigQuery;
210209
import com.google.gcloud.bigquery.BigQueryOptions;
211210
import com.google.gcloud.bigquery.DatasetInfo;
@@ -216,8 +215,6 @@ import com.google.gcloud.bigquery.InsertAllResponse;
216215
import com.google.gcloud.bigquery.QueryRequest;
217216
import com.google.gcloud.bigquery.QueryResponse;
218217
import com.google.gcloud.bigquery.Schema;
219-
import com.google.gcloud.bigquery.StandardTableDefinition;
220-
import com.google.gcloud.bigquery.Table;
221218
import com.google.gcloud.bigquery.TableId;
222219
import com.google.gcloud.bigquery.TableInfo;
223220

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

249245
// Define rows to insert
250246
Map<String, Object> firstRow = new HashMap<>();
@@ -271,7 +267,7 @@ public class GcloudBigQueryExample {
271267
.build();
272268
// Request query to be executed and wait for results
273269
QueryResponse queryResponse = bigquery.query(queryRequest);
274-
while (!queryResponse.jobCompleted()) {
270+
while (!queryResponse.jobComplete()) {
275271
Thread.sleep(1000L);
276272
queryResponse = bigquery.getQueryResults(queryResponse.jobId());
277273
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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>
45
<artifactId>gcloud-java-bigquery</artifactId>
56
<packaging>jar</packaging>
67
<name>GCloud Java bigquery</name>

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

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

328-
private static final long serialVersionUID = -6851072781269419383L;
329-
330328
private final TableId id;
331329

332330
/**

0 commit comments

Comments
 (0)