Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit f8c57c5

Browse files
Merge branch 'main' into jdbc/refactor-connection-properties
2 parents c98246f + 66addc3 commit f8c57c5

14 files changed

Lines changed: 214 additions & 85 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## [2.60.0](https://github.com/googleapis/java-bigquery/compare/v2.59.0...v2.60.0) (2026-02-26)
4+
5+
6+
### Features
7+
8+
* **jdbc:** Add retry mechanism for storage api ([#4100](https://github.com/googleapis/java-bigquery/issues/4100)) ([776caa1](https://github.com/googleapis/java-bigquery/commit/776caa19d5a4f54f35984a7d39375dd751d272cf))
9+
* **jdbc:** Enforce strict JDBC URL parsing and sync `DataSource` properties ([#4107](https://github.com/googleapis/java-bigquery/issues/4107)) ([0b0c1ce](https://github.com/googleapis/java-bigquery/commit/0b0c1ceb309a19d51f385264f2d4722b8b6339d7))
10+
11+
12+
### Bug Fixes
13+
14+
* Improve getErrorDescFromResponse() performance ([#4110](https://github.com/googleapis/java-bigquery/issues/4110)) ([4e0b409](https://github.com/googleapis/java-bigquery/commit/4e0b4099f6b690ac89f041eb0ff6e18439647e27))
15+
316
## [2.59.0](https://github.com/googleapis/java-bigquery/compare/v2.58.0...v2.59.0) (2026-02-12)
417

518

benchmark/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>google-cloud-bigquery-parent</artifactId>
88
<groupId>com.google.cloud</groupId>
9-
<version>2.59.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
9+
<version>2.60.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
1010
</parent>
1111

1212
<properties>

google-cloud-bigquery-bom/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.google.cloud</groupId>
55
<artifactId>google-cloud-bigquery-bom</artifactId>
6-
<version>2.59.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
6+
<version>2.60.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
77
<packaging>pom</packaging>
88
<parent>
99
<groupId>com.google.cloud</groupId>
@@ -54,7 +54,7 @@
5454
<dependency>
5555
<groupId>com.google.cloud</groupId>
5656
<artifactId>google-cloud-bigquery</artifactId>
57-
<version>2.59.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
57+
<version>2.60.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
5858
</dependency>
5959
</dependencies>
6060
</dependencyManagement>

google-cloud-bigquery-jdbc/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<modelVersion>4.0.0</modelVersion>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>google-cloud-bigquery-jdbc</artifactId>
23-
<version>0.3.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery-jdbc:current} -->
23+
<version>0.4.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery-jdbc:current} -->
2424
<packaging>jar</packaging>
2525
<name>BigQuery JDBC</name>
2626
<url>https://github.com/googleapis/java-bigquery-jdbc</url>
@@ -140,7 +140,7 @@
140140
<parent>
141141
<groupId>com.google.cloud</groupId>
142142
<artifactId>google-cloud-bigquery-parent</artifactId>
143-
<version>2.59.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
143+
<version>2.60.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
144144
</parent>
145145
<dependencies>
146146
<dependency>

google-cloud-bigquery/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.google.cloud</groupId>
55
<artifactId>google-cloud-bigquery</artifactId>
6-
<version>2.59.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
6+
<version>2.60.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
77
<packaging>jar</packaging>
88
<name>BigQuery</name>
99
<url>https://github.com/googleapis/java-bigquery</url>
1010
<description>BigQuery</description>
1111
<parent>
1212
<groupId>com.google.cloud</groupId>
1313
<artifactId>google-cloud-bigquery-parent</artifactId>
14-
<version>2.59.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
14+
<version>2.60.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigquery:current} -->
1515
</parent>
1616
<properties>
1717
<site.installationModule>google-cloud-bigquery</site.installationModule>

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,7 @@ public com.google.api.services.bigquery.model.QueryResponse call()
20152015
getOptions().getDataFormatOptions().useInt64Timestamp())))
20162016
.setJobId(jobId)
20172017
.setQueryId(results.getQueryId())
2018+
.setJobCreationReason(JobCreationReason.fromPb(results.getJobCreationReason()))
20182019
.build();
20192020
}
20202021
// only 1 page of result
@@ -2033,6 +2034,7 @@ public com.google.api.services.bigquery.model.QueryResponse call()
20332034
.setJobId(
20342035
results.getJobReference() != null ? JobId.fromPb(results.getJobReference()) : null)
20352036
.setQueryId(results.getQueryId())
2037+
.setJobCreationReason(JobCreationReason.fromPb(results.getJobCreationReason()))
20362038
.build();
20372039
}
20382040

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.google.cloud.bigquery;
17+
18+
import javax.annotation.Nullable;
19+
20+
/**
21+
* Maps to <a
22+
* href="https://docs.cloud.google.com/bigquery/docs/reference/rest/v2/JobCreationReason">JobCreationReason</a>
23+
* when used with {@link
24+
* com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode#JOB_CREATION_OPTIONAL}.
25+
*
26+
* <p>The code indicates the high level reason why a job was created. The default is `UNKNOWN` if
27+
* there is no mapping found between the server response and the client library.
28+
*/
29+
public class JobCreationReason {
30+
31+
public enum Code {
32+
REQUESTED("REQUESTED"),
33+
LONG_RUNNING("LONG_RUNNING"),
34+
LARGE_RESULTS("LARGE_RESULTS"),
35+
OTHER("OTHER"),
36+
UNKNOWN("UNKNOWN");
37+
38+
private final String reason;
39+
40+
Code(String reason) {
41+
this.reason = reason;
42+
}
43+
44+
/**
45+
* Maps the server code to BQ code. Returns {@link Code#UNKNOWN} if the mapping does not exist.
46+
*/
47+
static Code fromValue(@Nullable String reason) {
48+
for (JobCreationReason.Code code : Code.values()) {
49+
if (code.reason.equals(reason)) {
50+
return code;
51+
}
52+
}
53+
return UNKNOWN;
54+
}
55+
}
56+
57+
@Nullable private final Code code;
58+
59+
JobCreationReason(Code code) {
60+
this.code = code;
61+
}
62+
63+
static JobCreationReason fromPb(
64+
com.google.api.services.bigquery.model.JobCreationReason jobCreationReason) {
65+
// JobCreationReason may be null if the JobCreationMode is specified to be Optional
66+
// Note: JobCreationMode.Optional may also end up creating a job depending on the
67+
// query complexity and other factors.
68+
if (jobCreationReason == null) {
69+
return null;
70+
}
71+
return new JobCreationReason(Code.fromValue(jobCreationReason.getCode()));
72+
}
73+
74+
/**
75+
* @return JobCreationReason code or {@link Code#UNKNOWN} if mapping does not exist.
76+
*/
77+
public Code getCode() {
78+
return code;
79+
}
80+
}

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public abstract static class Builder {
4747

4848
public abstract TableResult.Builder setQueryId(String queryId);
4949

50+
public abstract TableResult.Builder setJobCreationReason(JobCreationReason jobCreationReason);
51+
5052
/** Creates a @code TableResult} object. */
5153
public abstract TableResult build();
5254
}
@@ -76,6 +78,9 @@ public static Builder newBuilder() {
7678
@Nullable
7779
public abstract String getQueryId();
7880

81+
@Nullable
82+
public abstract JobCreationReason getJobCreationReason();
83+
7984
@Override
8085
public boolean hasNextPage() {
8186
return getPageNoSchema().hasNextPage();
@@ -94,6 +99,7 @@ public TableResult getNextPage() {
9499
.setTotalRows(getTotalRows())
95100
.setPageNoSchema(getPageNoSchema().getNextPage())
96101
.setQueryId(getQueryId())
102+
.setJobCreationReason(getJobCreationReason())
97103
.build();
98104
}
99105
return null;

google-cloud-bigquery/src/test/java/MetadataCacheStatsTest.java renamed to google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/MetadataCacheStatsTest.java

File renamed without changes.

0 commit comments

Comments
 (0)