Skip to content

Commit 5803017

Browse files
authored
---
yaml --- r: 7503 b: refs/heads/tswast-patch-1 c: 36c66a5 h: refs/heads/master i: 7501: 91a2b54 7499: 627570f 7495: 0f7cc28 7487: 5487023
1 parent e5b42b8 commit 5803017

145 files changed

Lines changed: 9772 additions & 4367 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: 343f77df1f8941cde060cfd8ed79a7a6cf023db9
60+
refs/heads/tswast-patch-1: 36c66a5e82a2710ace6147c882c900d4d54bde0a
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ If you are using Maven, add this to your pom.xml file
3636
<dependency>
3737
<groupId>com.google.cloud</groupId>
3838
<artifactId>gcloud-java</artifactId>
39-
<version>0.2.7</version>
39+
<version>0.2.6</version>
4040
</dependency>
4141
```
4242
If you are using Gradle, add this to your dependencies
4343
```Groovy
44-
compile 'com.google.cloud:gcloud-java:0.2.7'
44+
compile 'com.google.cloud:gcloud-java:0.2.6'
4545
```
4646
If you are using SBT, add this to your dependencies
4747
```Scala
48-
libraryDependencies += "com.google.cloud" % "gcloud-java" % "0.2.7"
48+
libraryDependencies += "com.google.cloud" % "gcloud-java" % "0.2.6"
4949
```
5050

5151
Example Applications

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ If you are using Maven, add this to your pom.xml file
2222
<dependency>
2323
<groupId>com.google.cloud</groupId>
2424
<artifactId>gcloud-java-bigquery</artifactId>
25-
<version>0.2.7</version>
25+
<version>0.2.6</version>
2626
</dependency>
2727
```
2828
If you are using Gradle, add this to your dependencies
2929
```Groovy
30-
compile 'com.google.cloud:gcloud-java-bigquery:0.2.7'
30+
compile 'com.google.cloud:gcloud-java-bigquery:0.2.6'
3131
```
3232
If you are using SBT, add this to your dependencies
3333
```Scala
34-
libraryDependencies += "com.google.cloud" % "gcloud-java-bigquery" % "0.2.7"
34+
libraryDependencies += "com.google.cloud" % "gcloud-java-bigquery" % "0.2.6"
3535
```
3636

3737
Example Application

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>com.google.cloud</groupId>
1313
<artifactId>gcloud-java-pom</artifactId>
14-
<version>0.2.8-SNAPSHOT</version>
14+
<version>0.2.7-SNAPSHOT</version>
1515
</parent>
1616
<properties>
1717
<site.installationModule>gcloud-java-bigquery</site.installationModule>

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

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public final class QueryJobConfiguration extends JobConfiguration {
5151
private final Boolean useQueryCache;
5252
private final Boolean flattenResults;
5353
private final Boolean dryRun;
54-
private final Boolean useLegacySql;
5554

5655
/**
5756
* Priority levels for a query. If not specified the priority is assumed to be
@@ -88,7 +87,6 @@ public static final class Builder
8887
private Boolean useQueryCache;
8988
private Boolean flattenResults;
9089
private Boolean dryRun;
91-
private Boolean useLegacySql;
9290

9391
private Builder() {
9492
super(Type.QUERY);
@@ -108,7 +106,6 @@ private Builder(QueryJobConfiguration jobConfiguration) {
108106
this.useQueryCache = jobConfiguration.useQueryCache;
109107
this.flattenResults = jobConfiguration.flattenResults;
110108
this.dryRun = jobConfiguration.dryRun;
111-
this.useLegacySql = jobConfiguration.useLegacySql;
112109
}
113110

114111
private Builder(com.google.api.services.bigquery.model.JobConfiguration configurationPb) {
@@ -118,7 +115,6 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur
118115
allowLargeResults = queryConfigurationPb.getAllowLargeResults();
119116
useQueryCache = queryConfigurationPb.getUseQueryCache();
120117
flattenResults = queryConfigurationPb.getFlattenResults();
121-
useLegacySql = queryConfigurationPb.getUseLegacySql();
122118
dryRun = configurationPb.getDryRun();
123119
if (queryConfigurationPb.getDestinationTable() != null) {
124120
destinationTable = TableId.fromPb(queryConfigurationPb.getDestinationTable());
@@ -297,20 +293,6 @@ public Builder dryRun(Boolean dryRun) {
297293
return this;
298294
}
299295

300-
/**
301-
* Sets whether to use BigQuery's legacy SQL dialect for this query. If set to {@code false},
302-
* the query will use BigQuery's <a href="https://cloud.google.com/bigquery/sql-reference/">
303-
* Standard SQL</a>. When set to {@code false}, the values of
304-
* {@link #allowLargeResults(Boolean)} and {@link #flattenResults(Boolean)} are ignored; query
305-
* will be run as if {@link #allowLargeResults(Boolean)} is {@code true} and
306-
* {@link #flattenResults(Boolean)} is {@code false}. If not set, legacy SQL dialect is used.
307-
* This property is experimental and might be subject to change.
308-
*/
309-
public Builder useLegacySql(Boolean useLegacySql) {
310-
this.useLegacySql = useLegacySql;
311-
return this;
312-
}
313-
314296
public QueryJobConfiguration build() {
315297
return new QueryJobConfiguration(this);
316298
}
@@ -331,7 +313,6 @@ private QueryJobConfiguration(Builder builder) {
331313
this.tableDefinitions =
332314
builder.tableDefinitions != null ? ImmutableMap.copyOf(builder.tableDefinitions) : null;
333315
this.dryRun = builder.dryRun;
334-
this.useLegacySql = builder.useLegacySql;
335316
}
336317

337318
/**
@@ -445,18 +426,6 @@ public Boolean dryRun() {
445426
return dryRun;
446427
}
447428

448-
/**
449-
* Returns whether to use BigQuery's legacy SQL dialect for this query. If set to {@code false},
450-
* the query will use BigQuery's <a href="https://cloud.google.com/bigquery/sql-reference/">
451-
* Standard SQL</a>. When set to {@code false}, the values of {@link #allowLargeResults()} and
452-
* {@link #flattenResults()} are ignored; query will be run as if {@link #allowLargeResults()} is
453-
* {@code true} and {@link #flattenResults()} is {@code false}. If not set, legacy SQL dialect is
454-
* used. This property is experimental and might be subject to change.
455-
*/
456-
public Boolean useLegacySql() {
457-
return useLegacySql;
458-
}
459-
460429
@Override
461430
public Builder toBuilder() {
462431
return new Builder(this);
@@ -476,8 +445,7 @@ ToStringHelper toStringHelper() {
476445
.add("userDefinedFunctions", userDefinedFunctions)
477446
.add("createDisposition", createDisposition)
478447
.add("writeDisposition", writeDisposition)
479-
.add("dryRun", dryRun)
480-
.add("useLegacySql", useLegacySql);
448+
.add("dryRun", dryRun);
481449
}
482450

483451
@Override
@@ -491,7 +459,7 @@ public boolean equals(Object obj) {
491459
public int hashCode() {
492460
return Objects.hash(baseHashCode(), allowLargeResults, createDisposition, destinationTable,
493461
defaultDataset, flattenResults, priority, query, tableDefinitions, useQueryCache,
494-
userDefinedFunctions, writeDisposition, dryRun, useLegacySql);
462+
userDefinedFunctions, writeDisposition, dryRun);
495463
}
496464

497465
@Override
@@ -545,9 +513,6 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() {
545513
if (writeDisposition != null) {
546514
queryConfigurationPb.setWriteDisposition(writeDisposition.toString());
547515
}
548-
if (useLegacySql != null) {
549-
queryConfigurationPb.setUseLegacySql(useLegacySql);
550-
}
551516
return configurationPb.setQuery(queryConfigurationPb);
552517
}
553518

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

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ public final class QueryRequest implements Serializable {
7070
private final Long maxWaitTime;
7171
private final Boolean dryRun;
7272
private final Boolean useQueryCache;
73-
private final Boolean useLegacySql;
7473

7574
public static final class Builder {
7675

@@ -80,7 +79,6 @@ public static final class Builder {
8079
private Long maxWaitTime;
8180
private Boolean dryRun;
8281
private Boolean useQueryCache;
83-
private Boolean useLegacySql;
8482

8583
private Builder() {}
8684

@@ -152,17 +150,6 @@ public Builder useQueryCache(Boolean useQueryCache) {
152150
return this;
153151
}
154152

155-
/**
156-
* Sets whether to use BigQuery's legacy SQL dialect for this query. If set to {@code false},
157-
* the query will use BigQuery's <a href="https://cloud.google.com/bigquery/sql-reference/">
158-
* Standard SQL</a>. If not set, legacy SQL dialect is used. This property is experimental and
159-
* might be subject to change.
160-
*/
161-
public Builder useLegacySql(Boolean useLegacySql) {
162-
this.useLegacySql = useLegacySql;
163-
return this;
164-
}
165-
166153
public QueryRequest build() {
167154
return new QueryRequest(this);
168155
}
@@ -175,7 +162,6 @@ private QueryRequest(Builder builder) {
175162
maxWaitTime = builder.maxWaitTime;
176163
dryRun = builder.dryRun;
177164
useQueryCache = builder.useQueryCache;
178-
useLegacySql = builder.useLegacySql;
179165
}
180166

181167
/**
@@ -232,16 +218,6 @@ public Boolean useQueryCache() {
232218
return useQueryCache;
233219
}
234220

235-
/**
236-
* Returns whether to use BigQuery's legacy SQL dialect for this query. If set to {@code false},
237-
* the query will use BigQuery's <a href="https://cloud.google.com/bigquery/sql-reference/">
238-
* Standard SQL</a>. If not set, legacy SQL dialect is used. This property is experimental and
239-
* might be subject to change.
240-
*/
241-
public Boolean useLegacySql() {
242-
return useLegacySql;
243-
}
244-
245221
/**
246222
* Returns a builder for the {@code QueryRequest} object.
247223
*/
@@ -252,8 +228,7 @@ public Builder toBuilder() {
252228
.defaultDataset(defaultDataset)
253229
.maxWaitTime(maxWaitTime)
254230
.dryRun(dryRun)
255-
.useQueryCache(useQueryCache)
256-
.useLegacySql(useLegacySql);
231+
.useQueryCache(useQueryCache);
257232
}
258233

259234
@Override
@@ -265,14 +240,12 @@ public String toString() {
265240
.add("maxWaitTime", maxWaitTime)
266241
.add("dryRun", dryRun)
267242
.add("useQueryCache", useQueryCache)
268-
.add("useLegacySql", useLegacySql)
269243
.toString();
270244
}
271245

272246
@Override
273247
public int hashCode() {
274-
return Objects.hash(query, pageSize, defaultDataset, maxWaitTime, dryRun, useQueryCache,
275-
useLegacySql);
248+
return Objects.hash(query, pageSize, defaultDataset, maxWaitTime, dryRun, useQueryCache);
276249
}
277250

278251
@Override
@@ -308,9 +281,6 @@ com.google.api.services.bigquery.model.QueryRequest toPb() {
308281
if (useQueryCache != null) {
309282
queryRequestPb.setUseQueryCache(useQueryCache);
310283
}
311-
if (useLegacySql != null) {
312-
queryRequestPb.setUseLegacySql(useLegacySql);
313-
}
314284
return queryRequestPb;
315285
}
316286

@@ -345,9 +315,6 @@ static QueryRequest fromPb(com.google.api.services.bigquery.model.QueryRequest q
345315
if (queryRequestPb.getUseQueryCache() != null) {
346316
builder.useQueryCache(queryRequestPb.getUseQueryCache());
347317
}
348-
if (queryRequestPb.getUseLegacySql() != null) {
349-
builder.useLegacySql(queryRequestPb.getUseLegacySql());
350-
}
351318
return builder.build();
352319
}
353320
}

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public static class StreamingBuffer implements Serializable {
5353
private static final long serialVersionUID = 822027055549277843L;
5454
private final long estimatedRows;
5555
private final long estimatedBytes;
56-
private final Long oldestEntryTime;
56+
private final long oldestEntryTime;
5757

58-
StreamingBuffer(long estimatedRows, long estimatedBytes, Long oldestEntryTime) {
58+
StreamingBuffer(long estimatedRows, long estimatedBytes, long oldestEntryTime) {
5959
this.estimatedRows = estimatedRows;
6060
this.estimatedBytes = estimatedBytes;
6161
this.oldestEntryTime = oldestEntryTime;
@@ -77,9 +77,9 @@ public long estimatedBytes() {
7777

7878
/**
7979
* Returns the timestamp of the oldest entry in the streaming buffer, in milliseconds since
80-
* epoch. Returns {@code null} if the streaming buffer is empty.
80+
* epoch.
8181
*/
82-
public Long oldestEntryTime() {
82+
public long oldestEntryTime() {
8383
return oldestEntryTime;
8484
}
8585

@@ -111,13 +111,9 @@ Streamingbuffer toPb() {
111111
}
112112

113113
static StreamingBuffer fromPb(Streamingbuffer streamingBufferPb) {
114-
Long oldestEntryTime = null;
115-
if (streamingBufferPb.getOldestEntryTime() != null) {
116-
oldestEntryTime = streamingBufferPb.getOldestEntryTime().longValue();
117-
}
118114
return new StreamingBuffer(streamingBufferPb.getEstimatedRows().longValue(),
119115
streamingBufferPb.getEstimatedBytes().longValue(),
120-
oldestEntryTime);
116+
streamingBufferPb.getOldestEntryTime().longValue());
121117
}
122118
}
123119

branches/tswast-patch-1/gcloud-java-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public class QueryJobConfigurationTest {
7272
private static final boolean ALLOW_LARGE_RESULTS = true;
7373
private static final boolean USE_QUERY_CACHE = false;
7474
private static final boolean FLATTEN_RESULTS = true;
75-
private static final boolean USE_LEGACY_SQL = true;
7675
private static final List<UserDefinedFunction> USER_DEFINED_FUNCTIONS = ImmutableList.of(
7776
UserDefinedFunction.inline("Function"), UserDefinedFunction.fromUri("URI"));
7877
private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION =
@@ -88,7 +87,6 @@ public class QueryJobConfigurationTest {
8887
.flattenResults(FLATTEN_RESULTS)
8988
.userDefinedFunctions(USER_DEFINED_FUNCTIONS)
9089
.dryRun(true)
91-
.useLegacySql(USE_LEGACY_SQL)
9290
.build();
9391

9492
@Test
@@ -129,7 +127,6 @@ public void testBuilder() {
129127
assertEquals(USER_DEFINED_FUNCTIONS, QUERY_JOB_CONFIGURATION.userDefinedFunctions());
130128
assertEquals(WRITE_DISPOSITION, QUERY_JOB_CONFIGURATION.writeDisposition());
131129
assertTrue(QUERY_JOB_CONFIGURATION.dryRun());
132-
assertTrue(QUERY_JOB_CONFIGURATION.useLegacySql());
133130
}
134131

135132
@Test
@@ -168,6 +165,5 @@ private void compareQueryJobConfiguration(QueryJobConfiguration expected,
168165
assertEquals(expected.useQueryCache(), value.useQueryCache());
169166
assertEquals(expected.userDefinedFunctions(), value.userDefinedFunctions());
170167
assertEquals(expected.writeDisposition(), value.writeDisposition());
171-
assertEquals(expected.useLegacySql(), value.useLegacySql());
172168
}
173169
}

branches/tswast-patch-1/gcloud-java-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import static org.junit.Assert.assertEquals;
2020
import static org.junit.Assert.assertNull;
21-
import static org.junit.Assert.assertTrue;
2221

2322
import org.junit.Rule;
2423
import org.junit.Test;
@@ -32,14 +31,12 @@ public class QueryRequestTest {
3231
private static final Boolean DRY_RUN = false;
3332
private static final Long PAGE_SIZE = 42L;
3433
private static final Long MAX_WAIT_TIME = 42000L;
35-
private static final Boolean USE_LEGACY_SQL = true;
3634
private static final QueryRequest QUERY_REQUEST = QueryRequest.builder(QUERY)
3735
.useQueryCache(USE_QUERY_CACHE)
3836
.defaultDataset(DATASET_ID)
3937
.dryRun(DRY_RUN)
4038
.pageSize(PAGE_SIZE)
4139
.maxWaitTime(MAX_WAIT_TIME)
42-
.useLegacySql(USE_LEGACY_SQL)
4340
.build();
4441

4542
@Rule
@@ -70,7 +67,6 @@ public void testBuilder() {
7067
assertEquals(DRY_RUN, QUERY_REQUEST.dryRun());
7168
assertEquals(PAGE_SIZE, QUERY_REQUEST.pageSize());
7269
assertEquals(MAX_WAIT_TIME, QUERY_REQUEST.maxWaitTime());
73-
assertTrue(QUERY_REQUEST.useLegacySql());
7470
thrown.expect(NullPointerException.class);
7571
QueryRequest.builder(null);
7672
}
@@ -84,7 +80,6 @@ public void testOf() {
8480
assertNull(request.dryRun());
8581
assertNull(request.pageSize());
8682
assertNull(request.maxWaitTime());
87-
assertNull(request.useLegacySql());
8883
thrown.expect(NullPointerException.class);
8984
QueryRequest.of(null);
9085
}
@@ -109,6 +104,5 @@ private void compareQueryRequest(QueryRequest expected, QueryRequest value) {
109104
assertEquals(expected.dryRun(), value.dryRun());
110105
assertEquals(expected.pageSize(), value.pageSize());
111106
assertEquals(expected.maxWaitTime(), value.maxWaitTime());
112-
assertEquals(expected.useLegacySql(), value.useLegacySql());
113107
}
114108
}

0 commit comments

Comments
 (0)