Skip to content

Commit 2b4eff1

Browse files
fix: custom host for resumable uploads (#2696)
* fix: custom host for resumable uploads * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 61bb385 commit 2b4eff1

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery'
6060
If you are using Gradle without BOM, add this to your dependencies:
6161

6262
```Groovy
63-
implementation 'com.google.cloud:google-cloud-bigquery:2.25.0'
63+
implementation 'com.google.cloud:google-cloud-bigquery:2.26.0'
6464
```
6565

6666
If you are using SBT, add this to your dependencies:
6767

6868
```Scala
69-
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.25.0"
69+
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.26.0"
7070
```
7171
<!-- {x-version-update-end} -->
7272

@@ -348,7 +348,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
348348
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html
349349
[stability-image]: https://img.shields.io/badge/stability-stable-green
350350
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg
351-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.25.0
351+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.26.0
352352
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
353353
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
354354
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@
7777
public class HttpBigQueryRpc implements BigQueryRpc {
7878

7979
public static final String DEFAULT_PROJECTION = "full";
80-
private static final String BASE_RESUMABLE_URI =
81-
"https://www.googleapis.com/upload/bigquery/v2/projects/";
80+
private static final String BASE_RESUMABLE_URI = "upload/bigquery/v2/projects/";
8281
// see:
8382
// https://cloud.google.com/bigquery/loading-data-post-request#resume-upload
8483
private static final int HTTP_RESUME_INCOMPLETE = 308;
@@ -725,7 +724,11 @@ public QueryResponse queryRpc(String projectId, QueryRequest content) {
725724
@Override
726725
public String open(Job loadJob) {
727726
try {
728-
String builder = BASE_RESUMABLE_URI + options.getProjectId() + "/jobs";
727+
String builder = options.getHost();
728+
if (!builder.endsWith("/")) {
729+
builder += "/";
730+
}
731+
builder += BASE_RESUMABLE_URI + options.getProjectId() + "/jobs";
729732
GenericUrl url = new GenericUrl(builder);
730733
url.set("uploadType", "resumable");
731734
JsonFactory jsonFactory = bigquery.getJsonFactory();

0 commit comments

Comments
 (0)